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

noreply at shibboleth.net noreply at shibboleth.net
Wed May 25 21:15:29 EDT 2016


Author: scantor
Date: Wed May 25 21:15:29 2016
New Revision: 8259

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8259&view=rev
Log:
IDP-962 - Login flow or framework for combining authentication factors

Implement parameter passing from transition rules into flows.

Modified:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/MultiFactorAuthenticationTransition.java
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/MultiFactorAuthenticationContext.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java
    trunk/idp-conf/src/main/resources/conf/authn/mfa-authn-config.xml

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/MultiFactorAuthenticationTransition.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/MultiFactorAuthenticationTransition.java?rev=8259&r1=8258&r2=8259&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/MultiFactorAuthenticationTransition.java	(original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/MultiFactorAuthenticationTransition.java	Wed May 25 21:15:29 2016
@@ -55,6 +55,8 @@
  * flow to run by means of a function. If no mapping exists, or the function returns null, then the event
  * is simply raised as the result of the overall flow execution.</p>
  * 
+ * <p>A generic map can be used to pass data into flows, and allowing flows to be run with different inputs.</p>
+ * 
  * @since 3.3.0
  */
 public class MultiFactorAuthenticationTransition {
@@ -68,11 +70,15 @@
     /** A function that determines the next flow to execute. */
     @Nonnull @NonnullElements private Map<String,Function<ProfileRequestContext,String>> nextFlowStrategyMap;
     
+    /** A map of parameters for input to flow(s) that may be run. */
+    @Nonnull private Map<String,Object> flowParameterMap;
+    
     /** Constructor. */
     public MultiFactorAuthenticationTransition() {
         completionCondition = new DefaultCompletionCondition();
         resultMergingStrategy = new DefaultResultMergingStrategy();
         nextFlowStrategyMap = new HashMap<>();
+        flowParameterMap = Collections.emptyMap();
     }
     
     /**
@@ -185,6 +191,28 @@
      */
     public void setNextFlow(@Nullable @NotEmpty final String flowId) {
         setNextFlowStrategyMap(Collections.<String,Object>singletonMap("proceed", flowId));
+    }
+    
+    /**
+     * Get the mutable map of parameters for passage into flows that may be run.
+     * 
+     * @return mutable parameter map
+     */
+    @Nonnull @Live public Map<String,Object> getFlowParameterMap() {
+        return flowParameterMap;
+    }
+    
+    /**
+     * Set the map of parameters for passage into flows that may be run.
+     * 
+     * @param map parameter map
+     */
+    public void setFlowParameterMap(@Nullable final Map<String,Object> map) {
+        if (map != null) {
+            flowParameterMap = new HashMap<>(map);
+        } else {
+            flowParameterMap = Collections.emptyMap();
+        }
     }
 
     /**

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/MultiFactorAuthenticationContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/MultiFactorAuthenticationContext.java?rev=8259&r1=8258&r2=8259&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/MultiFactorAuthenticationContext.java	(original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/MultiFactorAuthenticationContext.java	Wed May 25 21:15:29 2016
@@ -17,6 +17,7 @@
 
 package net.shibboleth.idp.authn.context;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -50,17 +51,21 @@
     
     /** Authentication results that are active (may be generated earlier or during current request). */
     @Nonnull @NonnullElements private final Map<String,AuthenticationResult> activeResults;
+
+    /** Login flow descriptor for the MFA flow. */
+    @Nullable private AuthenticationFlowDescriptor mfaFlowDescriptor;
     
     /** The next flow due to execute (or the currently executing flow during subflow execution). */
     @Nullable @NotEmpty private String nextFlowId;
     
-    /** Login flow descriptor for the MFA flow. */
-    @Nullable private AuthenticationFlowDescriptor mfaFlowDescriptor;
+    /** Map of parameters into or out of flows. */
+    @Nonnull private Map<String,Object> flowParameterMap;
     
     /** Constructor. */
     public MultiFactorAuthenticationContext() {
         transitionMap = new HashMap<>();
         activeResults = new HashMap<>();
+        flowParameterMap = Collections.emptyMap();
     }
 
     /**
@@ -104,6 +109,29 @@
     }
     
     /**

[... 124 lines stripped ...]


More information about the commits mailing list