cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [2/2] cxf-fediz git commit: And adding some logging to BackChannelLogoutHandler as suggested by Ievgen
Date Fri, 18 Aug 2017 10:19:54 GMT
And adding some logging to BackChannelLogoutHandler as suggested by Ievgen


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/a620f226
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/a620f226
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/a620f226

Branch: refs/heads/1.4.x-fixes
Commit: a620f226e75f51eec4e0cb00658ba9361430290d
Parents: a78b1bb
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri Aug 18 11:19:29 2017 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri Aug 18 11:19:29 2017 +0100

----------------------------------------------------------------------
 .../service/oidc/logout/BackChannelLogoutHandler.java  | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/a620f226/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/BackChannelLogoutHandler.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/BackChannelLogoutHandler.java
b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/BackChannelLogoutHandler.java
index f97e642..5d1b50f 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/BackChannelLogoutHandler.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/BackChannelLogoutHandler.java
@@ -24,11 +24,14 @@ import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.logging.Logger;
 
 import javax.ws.rs.core.Form;
 
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.Base64UrlUtility;
 import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.cxf.jaxrs.utils.ExceptionUtils;
 import org.apache.cxf.rs.security.jose.jwt.JoseJwtProducer;
 import org.apache.cxf.rs.security.jose.jwt.JwtClaims;
 import org.apache.cxf.rs.security.jose.jwt.JwtToken;
@@ -40,6 +43,8 @@ import org.apache.cxf.rs.security.oidc.idp.OidcUserSubject;
 import org.apache.cxf.rt.security.crypto.CryptoUtils;
 
 public class BackChannelLogoutHandler extends JoseJwtProducer {
+    private static final Logger LOG = LogUtils.getL7dLogger(BackChannelLogoutHandler.class);
+
     private static final String BACK_CHANNEL_LOGOUT_URI = "backchannel_logout_uri";
     private static final String LOGOUT_TOKEN = "logout_token";
     private static final String EVENTS_PROPERTY = "events";
@@ -72,8 +77,8 @@ public class BackChannelLogoutHandler extends JoseJwtProducer {
 
     }
 
-    private void submitBackChannelLogoutRequest(Client client, OidcUserSubject subject,
-            IdToken idTokenHint, String uri) {
+    private void submitBackChannelLogoutRequest(final Client client, final OidcUserSubject
subject,
+            final IdToken idTokenHint, final String uri) {
         // Application context is expected to contain HttpConduit HTTPS configuration
         final WebClient wc = WebClient.create(uri);
         IdToken idToken = idTokenHint != null ? idTokenHint : subject.getIdToken(); 
@@ -93,7 +98,9 @@ public class BackChannelLogoutHandler extends JoseJwtProducer {
                 try {
                     wc.form(new Form().param(LOGOUT_TOKEN, logoutToken));
                 } catch (Exception ex) {
-                    // nothing else can be done
+                    LOG.info(String.format("Back channel request to %s to log out %s from
client %s has failed",
+                        uri, subject.getLogin(), client.getClientId()));
+                    LOG.fine(String.format("%s connection failure", ExceptionUtils.getStackTrace(ex)));
                 }
             }
         


Mime
View raw message