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

noreply at shibboleth.net noreply at shibboleth.net
Tue May 27 16:26:32 EDT 2014


Author: scantor
Date: Tue May 27 16:26:32 2014
New Revision: 5975

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5975&view=rev
Log:
Allow external authn to bypass SSO.

Modified:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/ExternalAuthentication.java
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/ExternalAuthenticationContext.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExternalAuthenticationImpl.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthentication.java

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/ExternalAuthentication.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/ExternalAuthentication.java?rev=5975&r1=5974&r2=5975&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/ExternalAuthentication.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/ExternalAuthentication.java Tue May 27 16:26:32 2014
@@ -48,6 +48,9 @@
 
     /** Request attribute to which an {@link AuthenticationException} may be bound. */
     @Nonnull @NotEmpty public static final String AUTHENTICATION_EXCEPTION_KEY = "authnException";
+
+    /** Request attribute to which a signal not to cache the result may be bound. */
+    @Nonnull @NotEmpty public static final String DONOTCACHE_KEY = "doNotCache";
     
     /** Request attribute that indicates whether the authentication request requires forced authentication. */
     @Nonnull @NotEmpty public static final String FORCE_AUTHN_PARAM = "forceAuthn";

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/ExternalAuthenticationContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/ExternalAuthenticationContext.java?rev=5975&r1=5974&r2=5975&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/ExternalAuthenticationContext.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/ExternalAuthenticationContext.java Tue May 27 16:26:32 2014
@@ -52,6 +52,9 @@
     /** Exception. */
     @Nullable private Exception authnException;
     
+    /** Flag preventing caching of result for SSO. */
+    private boolean doNotCache;
+    
     /**
      * Get the flow execution URL to return control to.
      * 
@@ -179,4 +182,22 @@
         authnException = exception;
     }
     
+    /**
+     * Get the "do not cache" flag.
+     * 
+     * @return true iff the result of the authentication should not be cached
+     */
+    public boolean doNotCache() {
+        return doNotCache;
+    }
+    
+    /**
+     * Set the "do not cache" flag.
+     * 
+     * @param flag flag to set 
+     */
+    public void setDoNotCache(final boolean flag) {
+        doNotCache = flag;
+    }
+    
 }

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExternalAuthenticationImpl.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExternalAuthenticationImpl.java?rev=5975&r1=5974&r2=5975&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExternalAuthenticationImpl.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExternalAuthenticationImpl.java Tue May 27 16:26:32 2014
@@ -164,6 +164,11 @@
             extContext.setAuthnException((Exception) attr);
         }
         
+        attr = request.getAttribute(DONOTCACHE_KEY);
+        if (attr != null && attr instanceof Boolean) {
+            extContext.setDoNotCache((Boolean) attr);
+        }
+        
         response.sendRedirect(extContext.getFlowExecutionUrl());
     }
 // Checkstyle: CyclomaticComplexity OFF

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthentication.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthentication.java?rev=5975&r1=5974&r2=5975&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthentication.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthentication.java Tue May 27 16:26:32 2014
@@ -121,6 +121,10 @@
             return;
         }
         
+        if (extContext.doNotCache()) {
+            log.debug("{} Disabling caching of authentication result", getLogPrefix());
+            authenticationContext.setResultCacheable(false);
+        }

[... 4 lines stripped ...]


More information about the commits mailing list