[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
Mon Aug 5 17:22:38 EDT 2013
Author: scantor
Date: Mon Aug 5 17:22:38 2013
New Revision: 4661
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4661&view=rev
Log:
Action that finalizes authentication and creates SubjectContext.
Added:
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FinalizeAuthentication.java (with props)
trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FinalizeAuthenticationTest.java (with props)
Modified:
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/SubjectContext.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=4661&r1=4660&r2=4661&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 Mon Aug 5 17:22:38 2013
@@ -63,6 +63,9 @@
/** A non-normative hint some protocols support to indicate who the subject might be. */
@Nullable private String hintedName;
+ /** The canonical principal name associated with the active session. */
+ @Nullable private String canonicalPrincipalName;
+
/** Flows that could potentially be used to authenticate the user. */
@Nonnull @NonnullElements private Map<String, AuthenticationFlowDescriptor> potentialFlows;
@@ -218,6 +221,27 @@
*/
@Nonnull public AuthenticationContext setHintedName(@Nullable final String hint) {
hintedName = StringSupport.trimOrNull(hint);
+ return this;
+ }
+
+ /**
+ * Get the canonical principal name associated with the active session, if any.
+ *
+ * @return the canonical principal name associated with the active session
+ */
+ @Nullable public String getCanonicalPrincipalName() {
+ return canonicalPrincipalName;
+ }
+
+ /**
+ * Get the canonical principal name associated with the active session, if any.
+ *
+ * @param principalName the principal name to set
+ *
+ * @return this authentication context
+ */
+ @Nonnull public AuthenticationContext setCanonicalPrincipalName(@Nullable final String principalName) {
+ canonicalPrincipalName = StringSupport.trimOrNull(principalName);
return this;
}
Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/SubjectContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/SubjectContext.java?rev=4661&r1=4660&r2=4661&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/SubjectContext.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/SubjectContext.java Mon Aug 5 17:22:38 2013
@@ -18,8 +18,9 @@
package net.shibboleth.idp.authn.context;
import java.util.ArrayList;
-import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -31,7 +32,7 @@
import org.opensaml.messaging.context.BaseContext;
-import com.google.common.collect.HashMultimap;
+import com.google.common.collect.ImmutableList;
/**
* A {@link BaseContext} that holds information about the subject of a transaction.
@@ -48,14 +49,14 @@
/** Canonical principal name of subject. */
@Nullable private String principalName;
- /** The active authentication events for the subject. */
- @Nonnull private final HashMultimap<String, AuthenticationResult> authenticationEvents;
+ /** The active authentication results for the subject. */
+ @Nonnull private final Map<String, AuthenticationResult> authenticationResults;
/** Constructor. */
public SubjectContext() {
super();
- authenticationEvents = HashMultimap.create(5, 1);
+ authenticationResults = new HashMap(5);
}
/**
@@ -77,12 +78,12 @@
}
/**
- * Get a mutable multimap of workflow IDs to authentication events.
+ * Get a mutable map of authentication flow IDs to authentication results.
*
- * @return mutable multimap of workflow IDs to authentication events
+ * @return mutable map of authentication flow IDs to authentication results
*/
- @Nonnull @NonnullElements public HashMultimap<String, AuthenticationResult> getAuthenticationEvents() {
- return authenticationEvents;
+ @Nonnull @NonnullElements public Map<String, AuthenticationResult> getAuthenticationResults() {
+ return authenticationResults;
}
/**
@@ -93,10 +94,10 @@
[... 13 lines stripped ...]
More information about the commits
mailing list