[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2: Pro...

noreply at shibboleth.net noreply at shibboleth.net
Tue Feb 4 23:14:04 EST 2014


Author: scantor
Date: Tue Feb  4 23:14:04 2014
New Revision: 5315

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5315&view=rev
Log:
IDP-159 - Revise action to process RequestedAuthnContext

Added:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContext.java
      - copied, changed from r5312, trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/SetRequestedAuthenticationWorkflows.java
Modified:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/SetRequestedAuthenticationWorkflows.java

Copied: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContext.java (from r5312, trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/SetRequestedAuthenticationWorkflows.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?p2=trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContext.java&p1=trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/SetRequestedAuthenticationWorkflows.java&r1=5312&r2=5315&rev=5315&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/SetRequestedAuthenticationWorkflows.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/ProcessRequestedAuthnContext.java Tue Feb  4 23:14:04 2014
@@ -17,140 +17,132 @@
 
 package net.shibboleth.idp.saml.impl.profile.saml2;
 
-import java.util.ArrayList;
-import java.util.HashMap;
+import java.security.Principal;
 import java.util.List;
-import java.util.Map;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
-import net.shibboleth.ext.spring.webflow.Event;
-import net.shibboleth.ext.spring.webflow.Events;
 import net.shibboleth.idp.authn.AbstractAuthenticationAction;
 import net.shibboleth.idp.authn.AuthenticationException;
-import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
 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.EventIds;
 import org.opensaml.profile.context.ProfileRequestContext;
-import org.opensaml.messaging.context.MessageContext;
+import org.opensaml.profile.context.navigate.InboundMessageContextLookup;
+import org.opensaml.messaging.context.navigate.MessageLookup;
 import org.opensaml.saml.saml2.core.AuthnContextClassRef;
+import org.opensaml.saml.saml2.core.AuthnContextComparisonTypeEnumeration;
 import org.opensaml.saml.saml2.core.AuthnContextDeclRef;
 import org.opensaml.saml.saml2.core.AuthnRequest;
 import org.opensaml.saml.saml2.core.RequestedAuthnContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.webflow.execution.RequestContext;
+
+import com.google.common.base.Function;
+import com.google.common.base.Functions;
+import com.google.common.collect.Lists;
 
 /**
- * An authentication action that populates the requested authentication workflows based on the incoming SAML 2
- * {@link AuthnRequest}.
+ * An authentication action that processes the {@link RequestedAuthnContext} in a SAML 2 {@link AuthnRequest},
+ * and populates a {@link RequestedPrincipalContext} with the corresponding information.
+ * 
+ * <p>Each requested context class or declaration reference is translated into a custom {@link Principal}
+ * for use by the authentication subsystem to drive flow selection.</p>
+ * 
+ * @event {@link EventIds#PROCEED_EVENT_ID}
+ * @event {@link EventIds#INVALID_MSG_CTX}
+ * 
+ * @post ProfileRequestContext.
  */
- at Events({@Event(id = EventIds.PROCEED_EVENT_ID),
-        @Event(id = EventIds.INVALID_MSG_CTX, description = "inbound message was missing or not a SAML 2 AuthnRequest")})
-public class SetRequestedAuthenticationWorkflows extends AbstractAuthenticationAction {
+public class ProcessRequestedAuthnContext extends AbstractAuthenticationAction<AuthnRequest, Object> {
 
     /** Class logger. */
-    private Logger log = LoggerFactory.getLogger(SetRequestedAuthenticationWorkflows.class);
+    @Nonnull private final Logger log = LoggerFactory.getLogger(ProcessRequestedAuthnContext.class);
+    
+    /** Lookup strategy function for obtaining {@link AuthnRequest}. */
+    @Nonnull private Function<ProfileRequestContext<AuthnRequest, Object>, AuthnRequest> authnRequestLookupStrategy;
 
-    /** {@inheritDoc} */

[... 163 lines stripped ...]


More information about the commits mailing list