[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/system/flows/admin/resolvertest-beans.xml idp-...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Apr 20 11:51:41 EDT 2016
Author: scantor
Date: Wed Apr 20 11:51:40 2016
New Revision: 8206
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8206&view=rev
Log:
IDP-978 - aacli isn't generating NameID results consistently with profiles
https://issues.shibboleth.net/jira/browse/IDP-978
Inject use of SSO profile configs as the driver for format selection.
Modified:
trunk/idp-conf/src/main/resources/system/flows/admin/resolvertest-beans.xml
trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/logic/DefaultNameIdentifierFormatStrategy.java
Modified: trunk/idp-conf/src/main/resources/system/flows/admin/resolvertest-beans.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/flows/admin/resolvertest-beans.xml?rev=8206&r1=8205&r2=8206&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/flows/admin/resolvertest-beans.xml (original)
+++ trunk/idp-conf/src/main/resources/system/flows/admin/resolvertest-beans.xml Wed Apr 20 11:51:40 2016
@@ -150,7 +150,11 @@
class="org.opensaml.saml.saml1.profile.impl.AddNameIdentifierToSubjects" scope="prototype">
<property name="formatLookupStrategy">
<bean class="net.shibboleth.idp.saml.profile.logic.DefaultNameIdentifierFormatStrategy"
- p:defaultFormat="%{idp.nameid.saml1.default:urn:mace:shibboleth:1.0:nameIdentifier}" />
+ p:defaultFormat="%{idp.nameid.saml1.default:urn:mace:shibboleth:1.0:nameIdentifier}">
+ <property name="profileId">
+ <util:constant static-field="net.shibboleth.idp.saml.saml1.profile.config.BrowserSSOProfileConfiguration.PROFILE_ID" />
+ </property>
+ </bean>
</property>
<property name="nameIdentifierGenerator">
<bean class="net.shibboleth.idp.saml.nameid.impl.ProxySAML1NameIdentifierGenerator"
@@ -170,7 +174,11 @@
class="org.opensaml.saml.saml2.profile.impl.AddNameIDToSubjects" scope="prototype">
<property name="formatLookupStrategy">
<bean class="net.shibboleth.idp.saml.profile.logic.DefaultNameIdentifierFormatStrategy"
- p:defaultFormat="%{idp.nameid.saml2.default:urn:oasis:names:tc:SAML:2.0:nameid-format:transient}" />
+ p:defaultFormat="%{idp.nameid.saml2.default:urn:oasis:names:tc:SAML:2.0:nameid-format:transient}">
+ <property name="profileId">
+ <util:constant static-field="net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration.PROFILE_ID" />
+ </property>
+ </bean>
</property>
<property name="nameIDGenerator">
<bean class="net.shibboleth.idp.saml.nameid.impl.ProxySAML2NameIDGenerator"
Modified: trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/logic/DefaultNameIdentifierFormatStrategy.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/logic/DefaultNameIdentifierFormatStrategy.java?rev=8206&r1=8205&r2=8206&view=diff
==============================================================================
--- trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/logic/DefaultNameIdentifierFormatStrategy.java (original)
+++ trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/logic/DefaultNameIdentifierFormatStrategy.java Wed Apr 20 11:51:40 2016
@@ -54,6 +54,9 @@
*/
@Nonnull private Function<ProfileRequestContext, RelyingPartyContext> relyingPartyContextLookupStrategy;
+ /** Override the {@link ProfileConfiguration} to look for rather than whatever's populated. */
+ @Nullable private String profileId;
+
/** Default format to use if nothing else is known. */
@Nonnull @NotEmpty private String defaultFormat;
@@ -76,6 +79,19 @@
relyingPartyContextLookupStrategy =
Constraint.isNotNull(strategy, "RelyingPartyContext lookup strategy cannot be null");
}
+
+ /**
+ * Set the profile configuration ID to locate in the {@link RelyingPartyConfiguration} for the purposes of
+ * establishing format precedence rules.
+ *
+ * <p>By default/without one set, the strategy is to use the configuration object populated in the
+ * {@link RelyingPartyContext}.</p>
+ *
+ * @param id profile ID to look for
+ */
+ public void setProfileId(@Nullable final String id) {
+ profileId = StringSupport.trimOrNull(id);
+ }
/**
* Set the default format to return.
@@ -93,8 +109,16 @@
final List<String> fromMetadata = super.apply(input);
final RelyingPartyContext relyingPartyCtx = relyingPartyContextLookupStrategy.apply(input);
- if (relyingPartyCtx != null) {
- final ProfileConfiguration profileConfig = relyingPartyCtx.getProfileConfig();
+ if (relyingPartyCtx != null && relyingPartyCtx.getConfiguration() != null) {
[... 29 lines stripped ...]
More information about the commits
mailing list