[java-identity-provider COMMIT] in /trunk: idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/Authenticatio...

noreply at shibboleth.net noreply at shibboleth.net
Tue Aug 20 11:39:22 EDT 2013


Author: scantor
Date: Tue Aug 20 11:39:22 2013
New Revision: 4708

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4708&view=rev
Log:
Redo authn selection action with new requested principal design.

Modified:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java
    trunk/idp-authn-api/src/test/java/net/shibboleth/idp/authn/context/AuthenticationContextTest.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlow.java
    trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java?rev=4708&r1=4707&r2=4708&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java Tue Aug 20 11:39:22 2013
@@ -19,7 +19,6 @@
 
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import javax.annotation.Nonnull;
@@ -40,7 +39,6 @@
 import org.opensaml.messaging.context.BaseContext;
 
 import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 
 /**
@@ -69,15 +67,12 @@
     /** Flows that could potentially be used to authenticate the user. */
     @Nonnull @NonnullElements private final Map<String, AuthenticationFlowDescriptor> potentialFlows;
 
-    /** The registry of predicate factories for custom principal evaluation. */
-    @Nonnull private PrincipalEvalPredicateFactoryRegistry evalRegistry;
-    
-    /** Flows, in order of preference, that satisfy an explicit requirement from the relying party. */
-    @Nonnull @NonnullElements private ImmutableList<AuthenticationFlowDescriptor> requestedFlows;
-
     /** Authentication results associated with an active session and available for (re)use. */
     @Nonnull @NonnullElements private final Map<String, AuthenticationResult> activeResults;
         
+    /** The registry of predicate factories for custom principal evaluation. */
+    @Nonnull private PrincipalEvalPredicateFactoryRegistry evalRegistry;
+
     /** Authentication flow being attempted to authenticate the user. */
     @Nullable private AuthenticationFlowDescriptor attemptedFlow;
     
@@ -94,11 +89,9 @@
         initiationInstant = System.currentTimeMillis();
         
         potentialFlows = new HashMap();
+        activeResults = new HashMap();
         
         evalRegistry = new PrincipalEvalPredicateFactoryRegistry();
-
-        activeResults = new HashMap();
-        requestedFlows = ImmutableList.of();
     }
 
     /**
@@ -247,35 +240,6 @@
      */
     @Nonnull public AuthenticationContext setCanonicalPrincipalName(@Nullable final String principalName) {
         canonicalPrincipalName = StringSupport.trimOrNull(principalName);
-        return this;
-    }
-    
-    /**
-     * Get the flows, in order of preference, that satisfy an explicit requirement from the relying party.
-     * 
-     * @return authentication flows, in order of preference, specified by the relying party
-     */
-    @Nonnull @NonnullElements @Unmodifiable public List<AuthenticationFlowDescriptor> getRequestedFlows() {
-        return requestedFlows;
-    }
-
-    /**
-     * Set the flows, in order of preference, that satisfy an explicit requirement from the relying party.
-     * 
-     * @param flows authentication flows, satisfy an explicit requirement from the relying party
-     * 
-     * @return this authentication context
-     */
-    @Nonnull public AuthenticationContext setRequestedFlows(
-            @Nonnull @NonnullElements final List<AuthenticationFlowDescriptor> flows) {
-        
-        if (Constraint.isNotNull(flows, "Flow list cannot be null").isEmpty()) {
-            requestedFlows = ImmutableList.of();
-            return this;
-        }
-
-        requestedFlows = ImmutableList.copyOf(flows);
-
         return this;
     }
 
@@ -351,8 +315,8 @@
                 .add("isPassive", isPassive).add("forceAuthn", forceAuthn).add("hintedName", hintedName)
                 .add("canonicalPrincipalName", canonicalPrincipalName)
                 .add("potentialFlows", potentialFlows.keySet())
-                .add("requestedFlows", requestedFlows)
-                .add("activeFlows", activeResults.keySet())
+                .add("activeResults", activeResults.keySet())
+                .add("attemptedFlow", attemptedFlow)
                 .add("completionInstant", new DateTime(completionInstant)).toString();
     }
 

Modified: trunk/idp-authn-api/src/test/java/net/shibboleth/idp/authn/context/AuthenticationContextTest.java

[... 591 lines stripped ...]


More information about the commits mailing list