Read entity ID and callback URL from properties only if needed.
@@ -332,11 +332,16 @@ public class ConfigurationService {
Constants.BINDING_HTTP_REDIRECT);
}
- // Common settings, required with or without metadata file.
- samlMap.put(SettingsBuilder.SP_ENTITYID_PROPERTY_KEY,
- getEntityId().toString());
+ // Read entity ID from properties if not provided within metadata XML
+ if (!samlMap.containsKey(SettingsBuilder.SP_ENTITYID_PROPERTY_KEY)) {
+ samlMap.put(SettingsBuilder.SP_ENTITYID_PROPERTY_KEY, getEntityId().toString());
+ }
+
+ // Derive ACS URL from properties if not provided within metadata XML
+ if (!samlMap.containsKey(SettingsBuilder.SP_ASSERTION_CONSUMER_SERVICE_URL_PROPERTY_KEY)) {
samlMap.put(SettingsBuilder.SP_ASSERTION_CONSUMER_SERVICE_URL_PROPERTY_KEY,
UriBuilder.fromUri(getCallbackUrl()).path("api/ext/saml/callback").build().toString());
+ }
SettingsBuilder samlBuilder = new SettingsBuilder();
Saml2Settings samlSettings = samlBuilder.fromValues(samlMap).build();
