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

noreply at shibboleth.net noreply at shibboleth.net
Fri Sep 25 23:16:33 EDT 2015


Author: scantor
Date: Fri Sep 25 23:16:33 2015
New Revision: 7788

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7788&view=rev
Log:
IDP-821 - Generally working "extended login" feature driven by password form

Modified:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationResult.java
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java
    trunk/idp-conf/src/main/resources/conf/authn/password-authn-config.xml
    trunk/idp-conf/src/main/resources/system/flows/authn/password-authn-beans.xml
    trunk/idp-conf/src/main/resources/system/flows/authn/password-authn-flow.xml
    trunk/idp-conf/src/main/resources/views/login.vm

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationResult.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationResult.java?rev=7788&r1=7787&r2=7788&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationResult.java	(original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationResult.java	Fri Sep 25 23:16:33 2015
@@ -42,8 +42,12 @@
 import com.google.common.collect.ImmutableSet;
 
 /**
- * Describes an act of authentication. The result may be composite, in the sense that it
- * may represent a combination of separate exchanges that make up a single overall result. 
+ * Describes an act of authentication.
+ *
+ * <p>Any authentication flow that succeeds must produce a single instance of this object.
+ * It may be composite, in the sense that it may represent a combination of separate exchanges
+ * that make up a single overall result, but the IdP always acts on a single result as the
+ * product of a given request for a login.</p>
  */
 @ThreadSafe
 public class AuthenticationResult implements PrincipalSupportingComponent {

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=7788&r1=7787&r2=7788&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	Fri Sep 25 23:16:33 2015
@@ -18,8 +18,9 @@
 package net.shibboleth.idp.authn.context;
 
 import java.security.Principal;
-import java.util.Collections;
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
@@ -375,30 +376,24 @@
     }
 
     /**
-     * Helper method that evaluates a {@link Principal} against a {@link RequestedPrincipalContext} child
-     * of this context, if present, to determine if the input is compatible with it.
+     * Helper method that evaluates a {@link PrincipalSupportingComponent} against a
+     * {@link RequestedPrincipalContext} child of this context, if present, to determine
+     * if the input is compatible with it.
      * 
      * @param <T> type of principal
-     * @param principal principal to evaluate
+     * @param component component to evaluate
      * 
      * @return true iff the input is compatible with the requested authentication requirements or if
      *  no such requirements have been imposed
      */
-    public <T extends Principal> boolean isAcceptable(@Nonnull final T principal) {
+    public <T extends Principal> boolean isAcceptable(@Nonnull final PrincipalSupportingComponent component) {
         final RequestedPrincipalContext rpCtx = getSubcontext(RequestedPrincipalContext.class);
         if (rpCtx != null) {
-            // Wrap candidate in the collection interface needed to drive the predicates.
-            final PrincipalSupportingComponent pseudoComponent = new PrincipalSupportingComponent() {
-                public <TT extends Principal> Set<TT> getSupportedPrincipals(Class<TT> c) {
-                    return Collections.<TT>singleton((TT) principal);
-                }
-            };
-            
             for (final Principal requestedPrincipal : rpCtx.getRequestedPrincipals()) {
                 final PrincipalEvalPredicateFactory factory =
                         evalRegistry.lookup(requestedPrincipal.getClass(), rpCtx.getOperator());
                 if (factory != null) {
-                    if (factory.getPredicate(requestedPrincipal).apply(pseudoComponent)) {
+                    if (factory.getPredicate(requestedPrincipal).apply(component)) {
                         return true;
                     }
                 }
@@ -407,6 +402,31 @@
             // Nothing matched the candidate.
             return false;
             
+        } else {

[... 226 lines stripped ...]


More information about the commits mailing list