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

noreply at shibboleth.net noreply at shibboleth.net
Mon Oct 21 13:40:41 EDT 2013


Author: scantor
Date: Mon Oct 21 13:40:40 2013
New Revision: 4887

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4887&view=rev
Log:
Add a slot for the subject c14n subflow to run.

Modified:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java?rev=4887&r1=4886&r2=4887&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java Mon Oct 21 13:40:40 2013
@@ -55,10 +55,13 @@
 
     /** Additional allowance for storage of result records to avoid race conditions during use. */
     public static final long STORAGE_EXPIRATION_OFFSET;
-    
+
+    /** Default subflow for subject canonicalization. */
+    @Nonnull @NotEmpty public static final String DEFAULT_SUBJECT_C14N_FLOWID;
+
     /** Default serializer for result objects. */
-    private static final StorageSerializer<AuthenticationResult> DEFAULT_SERIALIZER;
-    
+    @Nonnull private static final StorageSerializer<AuthenticationResult> DEFAULT_SERIALIZER;
+        
     /** The unique identifier of the authentication flow. */
     @Nonnull @NotEmpty private final String flowId;
 
@@ -84,6 +87,9 @@
     /** Custom serializer for the results generated by this flow. */
     @Nullable private StorageSerializer<AuthenticationResult> resultSerializer;
 
+    /** The unique identifier of the subject canonicalization subflow to be used. */
+    @Nullable private String subjectCanonicalizationFlowId;
+    
     /**
      * Constructor.
      * 
@@ -93,6 +99,7 @@
         flowId = Constraint.isNotNull(StringSupport.trimOrNull(id), "Workflow ID cannot be null or empty");
         supportedPrincipals = new Subject();
         inactivityTimeout = 30 * 60 * 1000;
+        subjectCanonicalizationFlowId = DEFAULT_SUBJECT_C14N_FLOWID;
     }
 
     /** {@inheritDoc} */
@@ -237,7 +244,27 @@
         resultSerializer = Constraint.isNotNull(serializer, "StorageSerializer cannot be null");
     }
 
-
+    /**
+     * Get the flow ID of the subject canonicalization subflow to run after any execution of the
+     * corresponding authentication flow.
+     * 
+     * @return  subject canonicalization flow ID
+     */
+    @Nonnull @NotEmpty String getSubjectCanonicalizationFlowId() {
+        return subjectCanonicalizationFlowId;
+    }
+    
+    /**
+     * Set the flow ID of the subject canonicalization subflow to run after any execution of the
+     * corresponding authentication flow.
+     * 
+     * @param c14nFlowId  subject canonicalization flow ID
+     */
+    void setSubjectCanonicalizationFlowId(@Nonnull @NotEmpty final String c14nFlowId) {
+        subjectCanonicalizationFlowId = Constraint.isNotNull(StringSupport.trimOrNull(c14nFlowId),
+                "Subject Canonicalization Flow ID cannot be null or empty");
+    }
+    
     /** {@inheritDoc} */
     @Nonnull @NotEmpty public String serialize(@Nonnull final AuthenticationResult instance) throws IOException {
         if (resultSerializer != null) {
@@ -286,12 +313,16 @@
     /** {@inheritDoc} */
     public String toString() {
         return Objects.toStringHelper(this).add("flowId", flowId).add("supportsPassive", supportsPassive)
-                .add("supportsForcedAuthentication", supportsForced).add("lifetime", lifetime)
-                .add("inactivityTimeout", inactivityTimeout).toString();
+                .add("supportsForcedAuthentication", supportsForced)
+                .add("lifetime", lifetime)
+                .add("inactivityTimeout", inactivityTimeout)
+                .add("subjectCanonicalizationFlowId", subjectCanonicalizationFlowId)
+                .toString();
     }
 
     static {
+        STORAGE_EXPIRATION_OFFSET = 10 * 60 * 1000;
+        DEFAULT_SUBJECT_C14N_FLOWID = "SubjectC14N/Simple";
         DEFAULT_SERIALIZER = new DefaultAuthenticationResultSerializer();
-        STORAGE_EXPIRATION_OFFSET = 10 * 60 * 1000;
     }
 }



More information about the commits mailing list