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

noreply at shibboleth.net noreply at shibboleth.net
Tue Jul 30 17:34:20 EDT 2013


Author: scantor
Date: Tue Jul 30 17:34:19 2013
New Revision: 4639

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4639&view=rev
Log:
Basic auth challenge and unit test

Added:
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendHTTPBasicAuthChallenge.java
      - copied, changed from r4633, trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendBasicHttpAuthenticationChallenge.java
    trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SendHTTPBasicAuthChallengeTest.java   (with props)
Modified:
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromBasicAuth.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendBasicHttpAuthenticationChallenge.java

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromBasicAuth.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromBasicAuth.java?rev=4639&r1=4638&r2=4639&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromBasicAuth.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromBasicAuth.java Tue Jul 30 17:34:19 2013
@@ -89,7 +89,7 @@
 
     /**
      * Gets the encoded credentials passed in via the {@link HttpHeaders#AUTHORIZATION} header. This method checks to
-     * ensure that the authentication scheme is {@link SendBasicHttpAuthenticationChallenge#BASIC} and then strips off
+     * ensure that the authentication scheme is {@link HttpServletRequest#BASIC_AUTH} and then strips off
      * and returns the follow on Base64-encoded credentials.
      * 
      * @param httpRequest current HTTP request

Copied: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendHTTPBasicAuthChallenge.java (from r4633, trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendBasicHttpAuthenticationChallenge.java)
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendHTTPBasicAuthChallenge.java?p2=trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendHTTPBasicAuthChallenge.java&p1=trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendBasicHttpAuthenticationChallenge.java&r1=4633&r2=4639&rev=4639&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendBasicHttpAuthenticationChallenge.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendHTTPBasicAuthChallenge.java Tue Jul 30 17:34:19 2013
@@ -20,11 +20,10 @@
 import javax.annotation.Nonnull;
 import javax.servlet.http.HttpServletResponse;
 
-import net.shibboleth.idp.authn.AbstractAuthenticationAction;
-import net.shibboleth.idp.authn.AuthenticationException;
-import net.shibboleth.idp.authn.context.AuthenticationContext;
-import net.shibboleth.idp.profile.ActionSupport;
-
+import org.opensaml.profile.ProfileException;
+import org.opensaml.profile.action.AbstractProfileAction;
+import org.opensaml.profile.action.ActionSupport;
+import org.opensaml.profile.action.EventIds;
 import org.opensaml.profile.context.ProfileRequestContext;
 
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
@@ -32,48 +31,68 @@
 import net.shibboleth.utilities.java.support.net.HttpServletSupport;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
-import org.springframework.webflow.execution.Event;
-import org.springframework.webflow.execution.RequestContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.net.HttpHeaders;
 
-/** A stage that prompts for HTTP Basic authentication credentials. */
-public class SendBasicHttpAuthenticationChallenge extends AbstractAuthenticationAction {
+/**
+ * An action that prompts for HTTP Basic authentication credentials.
+ * 
+ * @event {@link EventIds#PROCEED_EVENT_ID}
+ * @event {@link EventIds#INVALID_PROFILE_CTX}
+ * @pre <pre>ProfileRequestContext.getHttpResponse() != null</pre>
+ * @post A challenge response is issued to the client.
+ */
+public class SendHTTPBasicAuthChallenge extends AbstractProfileAction {
 
     /** The identifier for Basic authentication scheme. */
-    public static final String BASIC = "Basic";
+    @Nonnull public static final String BASIC = "Basic";
 
     /** The realm property identifier used during basic authentication. */
-    public static final String REALM = "realm";
+    @Nonnull public static final String REALM = "realm";
 
-    /** The value used for the {@value HttpHeaders#WWW_AUTHENTICATE}. */
-    private final String authenticateValue;
+    /** Class logger. */
+    @Nonnull private final Logger log = LoggerFactory.getLogger(InitializeAuthenticationContext.class);
+        

[... 61 lines stripped ...]


More information about the commits mailing list