[java-identity-provider COMMIT] in /trunk: idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAc...

noreply at shibboleth.net noreply at shibboleth.net
Wed Feb 5 13:02:23 EST 2014


Author: scantor
Date: Wed Feb  5 13:02:23 2014
New Revision: 5316

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5316&view=rev
Log:
IDP-159: bug fixes/unit test

Added:
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContextTest.java   (with props)
Modified:
    trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContext.java

Modified: trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java?rev=5316&r1=5315&r2=5316&view=diff
==============================================================================
--- trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java (original)
+++ trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java Wed Feb  5 13:02:23 2014
@@ -119,7 +119,7 @@
         final ProfileRequestContext<InboundMessageType, OutboundMessageType> profileRequestContext =
                 profileContextLookupStrategy.apply(springRequestContext);
         if (profileRequestContext == null) {
-            log.error("Action {}: IdP profile request context is not available", getId());
+            log.error("{} IdP profile request context is not available", getLogPrefix());
             return ActionSupport.buildEvent(this, EventIds.INVALID_PROFILE_CTX);
         }
 

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContext.java?rev=5316&r1=5315&r2=5316&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContext.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContext.java Wed Feb  5 13:02:23 2014
@@ -27,12 +27,12 @@
 import net.shibboleth.idp.authn.AuthenticationException;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
-import net.shibboleth.idp.profile.ActionSupport;
 import net.shibboleth.idp.saml.authn.principal.AuthnContextClassRefPrincipal;
 import net.shibboleth.idp.saml.authn.principal.AuthnContextDeclRefPrincipal;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
+import org.opensaml.profile.action.ActionSupport;
 import org.opensaml.profile.action.EventIds;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.profile.context.navigate.InboundMessageContextLookup;
@@ -121,11 +121,15 @@
         
         if (!requestedCtx.getAuthnContextClassRefs().isEmpty()) {
             for (final AuthnContextClassRef ref : requestedCtx.getAuthnContextClassRefs()) {
-                principals.add(new AuthnContextClassRefPrincipal(ref.getAuthnContextClassRef()));
+                if (ref.getAuthnContextClassRef() != null) {
+                    principals.add(new AuthnContextClassRefPrincipal(ref.getAuthnContextClassRef()));
+                }
             }
         } else if (!requestedCtx.getAuthnContextDeclRefs().isEmpty()) {
             for (final AuthnContextDeclRef ref : requestedCtx.getAuthnContextDeclRefs()) {
-                principals.add(new AuthnContextDeclRefPrincipal(ref.getAuthnContextDeclRef()));
+                if (ref.getAuthnContextDeclRef() != null) {
+                    principals.add(new AuthnContextDeclRefPrincipal(ref.getAuthnContextDeclRef()));
+                }
             }
         }
         
@@ -143,6 +147,8 @@
         rpCtx.setRequestedPrincipals(principals);
         
         authenticationContext.addSubcontext(rpCtx, true);
+        log.debug("{} RequestedPrincipalContext created with operator {} and {} custom principal(s)",
+                getLogPrefix(), rpCtx.getOperator(), principals.size());
     }
 
 }



More information about the commits mailing list