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

noreply at shibboleth.net noreply at shibboleth.net
Wed Apr 4 17:27:51 BST 2012


Author: lajoie
Date: Wed Apr  4 17:27:51 2012
New Revision: 4164

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4164&view=rev
Log:
Add java-support as a managed dep in the parent POM
Move to use the X.X-SNAPSHOT version name for our in-development projects to prevent patch releases from causing a problem
Re-org OpenSAML and IdP module lists just to make it easier to comment out impl modules

Modified:
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java
    trunk/idp-parent/pom.xml

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java?rev=4164&r1=4163&r2=4164&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java Wed Apr  4 17:27:51 2012
@@ -17,26 +17,40 @@
 
 package net.shibboleth.idp.authn.impl;
 
+import javax.annotation.Nonnull;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import net.shibboleth.idp.profile.AbstractIdentityProviderAction;
-import net.shibboleth.idp.profile.ProfileException;
+import net.shibboleth.idp.authn.AbstractAuthenticationAction;
+import net.shibboleth.idp.authn.AuthenticationException;
+import net.shibboleth.idp.authn.AuthenticationRequestContext;
+import net.shibboleth.idp.authn.UsernamePrincipal;
+import net.shibboleth.idp.profile.ActionSupport;
 import net.shibboleth.idp.profile.ProfileRequestContext;
+import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
 import org.springframework.webflow.execution.Event;
 import org.springframework.webflow.execution.RequestContext;
 
 /**
- *
+ * An authentication stage that checks that the request's REMOTE_USER is set and, if so, sets the identified user as the
+ * authenticated principal.
  */
-public class ValidateRemoteUser extends AbstractIdentityProviderAction {
+public class ValidateRemoteUser extends AbstractAuthenticationAction {
 
     /** {@inheritDoc} */
-    protected Event doExecute(final HttpServletRequest httpRequest, final HttpServletResponse httpResponse,
-            final RequestContext springRequestContext, final ProfileRequestContext profileRequestContext) throws ProfileException {
-        // TODO Auto-generated method stub
-        return null;
+    protected Event doExecute(@Nonnull final HttpServletRequest httpRequest,
+            @Nonnull final HttpServletResponse httpResponse, @Nonnull final RequestContext springRequestContext,
+            @Nonnull final ProfileRequestContext profileRequestContext,
+            @Nonnull final AuthenticationRequestContext authenticationContext) throws AuthenticationException {
+
+        final String remoteUser = StringSupport.trimOrNull(httpRequest.getRemoteUser());
+        if (remoteUser == null) {
+            // TODO error case
+        }
+
+        authenticationContext.setAuthenticatedPrincipal(new UsernamePrincipal(remoteUser));
+
+        return ActionSupport.buildProceedEvent(this);
     }
-
 }

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java?rev=4164&r1=4163&r2=4164&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java Wed Apr  4 17:27:51 2012
@@ -95,7 +95,6 @@
 
         if (isAuthenticated(uaaCtx.getUserAgentAddress())) {
             authenticationContext.setAuthenticatedPrincipal(new UsernamePrincipal(authenticatedUser));
-            authenticationContext.setCompletionInstant();
         }
 
         return ActionSupport.buildProceedEvent(this);

Modified: trunk/idp-parent/pom.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-parent/pom.xml?rev=4164&r1=4163&r2=4164&view=diff
==============================================================================
--- trunk/idp-parent/pom.xml (original)
+++ trunk/idp-parent/pom.xml Wed Apr  4 17:27:51 2012
@@ -26,28 +26,29 @@
     <modules>
         <module>../idp-core</module>
         <module>../idp-authn-api</module>
-        <module>../idp-authn-impl</module>
         <module>../idp-attribute-api</module>
-        <module>../idp-attribute-impl</module>
         <module>../idp-attribute-resolver-api</module>
-        <module>../idp-attribute-resolver-impl</module>
         <module>../idp-attribute-filter-api</module>

[... 38 lines stripped ...]


More information about the commits mailing list