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

noreply at shibboleth.net noreply at shibboleth.net
Wed Jul 30 16:25:37 EDT 2014


Author: scantor
Date: Wed Jul 30 16:25:37 2014
New Revision: 6365

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6365&view=rev
Log:
Add a slot to hold a signal for flow to run, enabling flows to signal each other.

Modified:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.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=6365&r1=6364&r2=6365&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 Wed Jul 30 16:25:37 2014
@@ -76,6 +76,9 @@
     /** Authentication flow being attempted to authenticate the user. */
     @Nullable private AuthenticationFlowDescriptor attemptedFlow;
     
+    /** Signals authentication flow to run next, to influence selection logic. */
+    @Nullable private String signaledFlowId;
+    
     /** A successfully processed authentication result (the output of the attempted flow, if any). */
     @Nullable private AuthenticationResult authenticationResult;
 
@@ -261,6 +264,27 @@
     }
     
     /**
+     * Get the flow ID signaled as the next selection.
+     * 
+     * @return  ID of flow to run next
+     */
+    @Nullable public String getSignaledFlowId() {
+        return signaledFlowId;
+    }
+    
+    /**
+     * Set the flow ID signaled as the next selection.
+     * 
+     * @param id ID of flow to run next
+     * 
+     * @return this authentication context
+     */
+    @Nonnull public AuthenticationContext setSignaledFlowId(@Nullable final String id) {
+        signaledFlowId = StringSupport.trimOrNull(id);
+        return this;
+    }    
+    
+    /**
      * Get the authentication result produced by the attempted flow, or reused for SSO.
      * 
      * @return authentication result, if any
@@ -322,13 +346,18 @@
     /** {@inheritDoc} */
     @Override
     public String toString() {
-        return Objects.toStringHelper(this).add("initiationInstant", new DateTime(initiationInstant))
-                .add("isPassive", isPassive).add("forceAuthn", forceAuthn).add("hintedName", hintedName)
+        return Objects.toStringHelper(this)
+                .add("initiationInstant", new DateTime(initiationInstant))
+                .add("isPassive", isPassive)
+                .add("forceAuthn", forceAuthn)
+                .add("hintedName", hintedName)
                 .add("potentialFlows", potentialFlows.keySet())
                 .add("activeResults", activeResults.keySet())
                 .add("attemptedFlow", attemptedFlow)
+                .add("signaledFlowId", signaledFlowId)
                 .add("resultCacheable", resultCacheable)
-                .add("completionInstant", new DateTime(completionInstant)).toString();
+                .add("completionInstant", new DateTime(completionInstant))
+                .toString();
     }
 
 }



More information about the commits mailing list