Skip to content

Commit b2e36ec

Browse files
committed
Addressing issue: #3661
The alias cannot be a URL. Backwards compatible behavior is to use the hostname for the alias
1 parent 91117cf commit b2e36ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlRelyingPartyRegistrationRepositoryConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import lombok.extern.slf4j.Slf4j;
44
import org.cloudfoundry.identity.uaa.provider.SamlIdentityProviderDefinition;
55
import org.cloudfoundry.identity.uaa.util.KeyWithCert;
6+
import org.cloudfoundry.identity.uaa.util.UaaStringUtils;
67
import org.springframework.beans.factory.annotation.Qualifier;
78
import org.springframework.beans.factory.annotation.Value;
89
import org.springframework.context.annotation.Bean;
@@ -49,7 +50,8 @@ RelyingPartyRegistrationRepository relyingPartyRegistrationRepository(SamlIdenti
4950
List<KeyWithCert> defaultKeysWithCerts = samlKeyManager.getAvailableCredentials();
5051

5152
List<RelyingPartyRegistration> relyingPartyRegistrations = new ArrayList<>();
52-
String uaaWideSamlEntityIDAlias = samlConfigProps.getEntityIDAlias() != null ? samlConfigProps.getEntityIDAlias() : samlEntityID;
53+
String uaaWideSamlEntityIDAlias = samlConfigProps.getEntityIDAlias() != null ? samlConfigProps.getEntityIDAlias() :
54+
UaaStringUtils.getHostIfArgIsURL(samlEntityID);
5355

5456
@SuppressWarnings("java:S125")
5557
// Spring Security requires at least one relyingPartyRegistration before SAML SP metadata generation;

0 commit comments

Comments
 (0)