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

noreply at shibboleth.net noreply at shibboleth.net
Mon Jun 22 11:21:33 EDT 2015


Author: scantor
Date: Mon Jun 22 11:21:32 2015
New Revision: 7588

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7588&view=rev
Log:
IDP-748 - Pass through consent revocation param back into external auth API

Modified:
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/RemoteUserAuthServlet.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/X509AuthServlet.java

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/RemoteUserAuthServlet.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/RemoteUserAuthServlet.java?rev=7588&r1=7587&r2=7588&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/RemoteUserAuthServlet.java	(original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/RemoteUserAuthServlet.java	Mon Jun 22 11:21:32 2015
@@ -39,6 +39,7 @@
 import net.shibboleth.idp.authn.ExternalAuthenticationException;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.principal.UsernamePrincipal;
+import net.shibboleth.idp.profile.interceptor.ProfileInterceptorFlowDescriptor;
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
@@ -295,6 +296,12 @@
                 httpRequest.setAttribute(ExternalAuthentication.PRINCIPAL_NAME_KEY, username);
             }
             
+            final String revokeConsent =
+                    httpRequest.getParameter(ProfileInterceptorFlowDescriptor.REVOKE_CONSENT_PARAM);
+            if (revokeConsent != null && ("1".equals(revokeConsent) || "true".equals(revokeConsent))) {
+                httpRequest.setAttribute(ExternalAuthentication.REVOKECONSENT_KEY, Boolean.TRUE);
+            }
+            
             ExternalAuthentication.finishExternalAuthentication(key, httpRequest, httpResponse);
             
         } catch (final ExternalAuthenticationException e) {

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/X509AuthServlet.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/X509AuthServlet.java?rev=7588&r1=7587&r2=7588&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/X509AuthServlet.java	(original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/X509AuthServlet.java	Mon Jun 22 11:21:32 2015
@@ -34,6 +34,7 @@
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.ExternalAuthentication;
 import net.shibboleth.idp.authn.ExternalAuthenticationException;
+import net.shibboleth.idp.profile.interceptor.ProfileInterceptorFlowDescriptor;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
 
@@ -96,6 +97,7 @@
         }
     }
 
+// Checkstyle: CyclomaticComplexity OFF
     /** {@inheritDoc} */
     @Override
     protected void service(final HttpServletRequest httpRequest, final HttpServletResponse httpResponse)
@@ -155,6 +157,12 @@
             subject.getPrincipals().add(cert.getSubjectX500Principal());
 
             httpRequest.setAttribute(ExternalAuthentication.SUBJECT_KEY, subject);
+            
+            final String revokeConsent =
+                    httpRequest.getParameter(ProfileInterceptorFlowDescriptor.REVOKE_CONSENT_PARAM);
+            if (revokeConsent != null && ("1".equals(revokeConsent) || "true".equals(revokeConsent))) {
+                httpRequest.setAttribute(ExternalAuthentication.REVOKECONSENT_KEY, Boolean.TRUE);
+            }
 
             ExternalAuthentication.finishExternalAuthentication(key, httpRequest, httpResponse);
             
@@ -162,5 +170,6 @@
             throw new ServletException("Error processing external authentication request", e);
         }
     }
+// Checkstyle: CyclomaticComplexity ON
     
 }



More information about the commits mailing list