cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Removing IdToken property from UserInfo
Date Tue, 15 Dec 2015 13:02:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/master b316007cc -> 3fb5e2464


Removing IdToken property from UserInfo


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

Branch: refs/heads/master
Commit: 3fb5e246440f0c269c9c248a22f1b5a7f41f7db0
Parents: b316007
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Dec 15 13:02:40 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Dec 15 13:02:40 2015 +0000

----------------------------------------------------------------------
 .../apache/cxf/rs/security/oidc/common/UserInfo.java    |  7 -------
 .../cxf/rs/security/oidc/rp/OidcClientTokenContext.java |  2 +-
 .../cxf/rs/security/oidc/rp/OidcUserInfoProvider.java   | 12 ++++++++----
 .../apache/cxf/rs/security/oidc/rp/UserInfoContext.java |  2 +-
 4 files changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/3fb5e246/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/common/UserInfo.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/common/UserInfo.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/common/UserInfo.java
index 06b4e96..1ac2986 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/common/UserInfo.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/common/UserInfo.java
@@ -24,7 +24,6 @@ import java.util.Map;
 import org.apache.cxf.rs.security.jose.jwt.JwtClaims;
 
 public class UserInfo extends AbstractUserInfo {
-    private IdToken idToken;
     public UserInfo() {
     }
     public UserInfo(JwtClaims claims) {
@@ -33,10 +32,4 @@ public class UserInfo extends AbstractUserInfo {
     public UserInfo(Map<String, Object> claims) {
         super(new LinkedHashMap<String, Object>(claims));
     }
-    public IdToken getIdToken() {
-        return idToken;
-    }
-    public void setIdToken(IdToken idToken) {
-        this.idToken = idToken;
-    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/3fb5e246/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientTokenContext.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientTokenContext.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientTokenContext.java
index 5187392..5f430be 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientTokenContext.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientTokenContext.java
@@ -21,5 +21,5 @@ package org.apache.cxf.rs.security.oidc.rp;
 import org.apache.cxf.rs.security.oauth2.client.ClientTokenContext;
 
 public interface OidcClientTokenContext extends ClientTokenContext,
-    IdTokenContext, UserInfoContext {
+    UserInfoContext {
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/3fb5e246/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcUserInfoProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcUserInfoProvider.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcUserInfoProvider.java
index 822d13b..386dd5e 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcUserInfoProvider.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcUserInfoProvider.java
@@ -21,24 +21,28 @@ package org.apache.cxf.rs.security.oidc.rp;
 import org.apache.cxf.jaxrs.ext.ContextProvider;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.rs.security.oauth2.client.ClientTokenContext;
+import org.apache.cxf.rs.security.oidc.common.IdToken;
 import org.apache.cxf.rs.security.oidc.common.UserInfo;
 
 public class OidcUserInfoProvider implements ContextProvider<UserInfoContext> {
 
     @Override
     public UserInfoContext createContext(Message m) {
-        OidcClientTokenContext ctx = (OidcClientTokenContext)
+        final OidcClientTokenContext ctx = (OidcClientTokenContext)
             m.getContent(ClientTokenContext.class);
         final UserInfo userInfo = ctx != null ? ctx.getUserInfo() : m.getContent(UserInfo.class);
         if (userInfo != null) {
-            if (ctx != null) {
-                userInfo.setIdToken(ctx.getIdToken());
-            }
+            final IdToken idToken = ctx != null ? ctx.getIdToken() : m.getContent(IdToken.class);
             return new UserInfoContext() {
 
                 @Override
                 public UserInfo getUserInfo() {
                     return userInfo;
+                }
+
+                @Override
+                public IdToken getIdToken() {
+                    return idToken;
                 } 
                 
             };

http://git-wip-us.apache.org/repos/asf/cxf/blob/3fb5e246/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/UserInfoContext.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/UserInfoContext.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/UserInfoContext.java
index 0a98068..8d2ab6d 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/UserInfoContext.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/UserInfoContext.java
@@ -20,6 +20,6 @@ package org.apache.cxf.rs.security.oidc.rp;
 
 import org.apache.cxf.rs.security.oidc.common.UserInfo;
 
-public interface UserInfoContext {
+public interface UserInfoContext extends IdTokenContext {
     UserInfo getUserInfo();
 }


Mime
View raw message