[cxf-fediz] branch master updated: FEDIZ-243 - Fixing up the previous PR

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[cxf-fediz] branch master updated: FEDIZ-243 - Fixing up the previous PR

coheigea
Administrator
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git


The following commit(s) were added to refs/heads/master by this push:
     new 2f53922  FEDIZ-243 - Fixing up the previous PR
2f53922 is described below

commit 2f53922a9c1fa942bf7aa9258e951eba45c4f49c
Author: Colm O hEigeartaigh <[hidden email]>
AuthorDate: Thu May 21 12:46:21 2020 +0100

    FEDIZ-243 - Fixing up the previous PR
---
 .../java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java     | 2 ++
 .../java/org/apache/cxf/fediz/tomcat/handler/TomcatSigninHandler.java | 4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/plugins/tomcat/src/main/java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java b/plugins/tomcat/src/main/java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java
index 213613f..e61bdbf 100644
--- a/plugins/tomcat/src/main/java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java
+++ b/plugins/tomcat/src/main/java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java
@@ -202,6 +202,8 @@ public class FederationAuthenticator extends FormAuthenticator {
         if (signinHandler.canHandleRequest(request)) {
             FedizPrincipal principal = signinHandler.handleRequest(request, response);
             if (principal != null) {
+                // Register the authenticated Principal
+                register(request, response, principal, FederationConstants.WSFED_METHOD, null, null);
                 LOG.debug("Authentication of '{}' was successful", principal);
                 resumeRequest(signinHandler.getContextParameter(request), request, response);
             } else {
diff --git a/plugins/tomcat/src/main/java/org/apache/cxf/fediz/tomcat/handler/TomcatSigninHandler.java b/plugins/tomcat/src/main/java/org/apache/cxf/fediz/tomcat/handler/TomcatSigninHandler.java
index 77a30b5..33e6c82 100644
--- a/plugins/tomcat/src/main/java/org/apache/cxf/fediz/tomcat/handler/TomcatSigninHandler.java
+++ b/plugins/tomcat/src/main/java/org/apache/cxf/fediz/tomcat/handler/TomcatSigninHandler.java
@@ -27,7 +27,6 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.catalina.Session;
-import org.apache.catalina.authenticator.Constants;
 import org.apache.catalina.connector.Request;
 import org.apache.cxf.fediz.core.FedizPrincipal;
 import org.apache.cxf.fediz.core.config.FedizContext;
@@ -66,9 +65,6 @@ public class TomcatSigninHandler extends SigninHandler<FedizPrincipal> {
 
         Session session = ((Request)request).getSessionInternal();
 
-        // Register the authenticated Principal
-        register((Request) request, response, principal, FederationConstants.WSFED_METHOD, null, null);
-
         // Save Federation response in our session
         session.setNote(FederationAuthenticator.FEDERATION_NOTE, wfRes);