cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-7201] Ending up with optionally converting a clear form UserInfo to String
Date Fri, 30 Dec 2016 13:36:15 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes b0f9492ba -> 919d84dd4


[CXF-7201] Ending up with optionally converting a clear form UserInfo to String


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

Branch: refs/heads/3.1.x-fixes
Commit: 919d84dd4e2c0bb5dd7e0de9e7d176c191b06029
Parents: b0f9492
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri Dec 30 13:33:22 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri Dec 30 13:35:50 2016 +0000

----------------------------------------------------------------------
 .../apache/cxf/rs/security/oidc/idp/UserInfoService.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/919d84dd/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/UserInfoService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/UserInfoService.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/UserInfoService.java
index 4fa5df9..41ecc66 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/UserInfoService.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/UserInfoService.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.Response;
 
 import org.apache.cxf.jaxrs.ext.MessageContext;
 import org.apache.cxf.rs.security.jose.jwt.JwtToken;
+import org.apache.cxf.rs.security.jose.jwt.JwtUtils;
 import org.apache.cxf.rs.security.oauth2.common.Client;
 import org.apache.cxf.rs.security.oauth2.common.OAuthContext;
 import org.apache.cxf.rs.security.oauth2.provider.OAuthDataProvider;
@@ -43,7 +44,7 @@ public class UserInfoService extends OAuthServerJoseJwtProducer {
     private UserInfoProvider userInfoProvider;
     private OAuthDataProvider oauthDataProvider;
     private List<String> additionalClaims = Collections.emptyList();
-    
+    private boolean convertClearUserInfoToString;
     @Context
     private MessageContext mc;
     @GET
@@ -83,9 +84,7 @@ public class UserInfoService extends OAuthServerJoseJwtProducer {
     
     protected Object convertUserInfoToResponseEntity(UserInfo userInfo) {
         // By default a JAX-RS MessageBodyWriter is expected to serialize UserInfo.
-        // Custom implementations of this method may further augment UserInfo or
-        // convert it to String: JwtUtils.claimsToJson(userInfo);
-        return userInfo;
+        return convertClearUserInfoToString ? JwtUtils.claimsToJson(userInfo) : userInfo;
     }
 
     protected UserInfo createFromIdToken(IdToken idToken) {
@@ -141,4 +140,8 @@ public class UserInfoService extends OAuthServerJoseJwtProducer {
     public void setAdditionalClaims(List<String> additionalClaims) {
         this.additionalClaims = additionalClaims;
     }
+
+    public void setConvertClearUserInfoToString(boolean convertClearUserInfoToString) {
+        this.convertClearUserInfoToString = convertClearUserInfoToString;
+    }
 }


Mime
View raw message