You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2018/07/18 09:24:04 UTC

[cxf] 01/05: Log the AccessTokenService error

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

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

commit 4548d5c1828d661cea227beaa8736a2505051d2a
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Jul 17 12:31:50 2018 +0100

    Log the AccessTokenService error
    
    (cherry picked from commit 91feb64c98ffe1835075e1fa8d782e43e0c785ee)
    (cherry picked from commit 42590d0cb6068b413ff22652a203dfc9a12dcf63)
    
    # Conflicts:
    #	rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java
---
 .../cxf/rs/security/oauth2/services/AccessTokenService.java   | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java
index b31d6b4..27c72d7 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java
@@ -65,10 +65,10 @@ public class AccessTokenService extends AbstractTokenService {
     protected void injectContextIntoOAuthProviders() {
         super.injectContextIntoOAuthProviders();
         for (AccessTokenGrantHandler grantHandler : grantHandlers) {
-            OAuthUtils.injectContextIntoOAuthProvider(getMessageContext(), grantHandler);    
+            OAuthUtils.injectContextIntoOAuthProvider(getMessageContext(), grantHandler);
         }
     }
-    
+
     /**
      * Sets a grant handler
      * @param handler the grant handler
@@ -125,9 +125,10 @@ public class AccessTokenService extends AbstractTokenService {
         } catch (WebApplicationException ex) {
             throw ex;
         } catch (RuntimeException ex) {
-            // This is done to bypass a Check-Style 
-            // restriction on a number of return statements 
-            OAuthServiceException oauthEx = ex instanceof OAuthServiceException 
+            LOG.log(Level.FINE, "Error creating the access token", ex);
+            // This is done to bypass a Check-Style
+            // restriction on a number of return statements
+            OAuthServiceException oauthEx = ex instanceof OAuthServiceException
                 ? (OAuthServiceException)ex : new OAuthServiceException(ex);
             return handleException(oauthEx, OAuthConstants.INVALID_GRANT);
         }