cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Converting a username in the introspection response
Date Tue, 09 Feb 2016 13:56:17 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes d0e42861b -> 87fd53f90


Converting a username in the introspection response


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

Branch: refs/heads/3.1.x-fixes
Commit: 87fd53f908c9cdbcf37b2c763664d66f4a4b8420
Parents: d0e4286
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Feb 9 13:55:48 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Feb 9 13:55:48 2016 +0000

----------------------------------------------------------------------
 .../security/oauth2/filters/AccessTokenIntrospectionClient.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/87fd53f9/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/AccessTokenIntrospectionClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/AccessTokenIntrospectionClient.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/AccessTokenIntrospectionClient.java
index 778b732..679aafa 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/AccessTokenIntrospectionClient.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/AccessTokenIntrospectionClient.java
@@ -32,6 +32,7 @@ import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.rs.security.oauth2.common.AccessTokenValidation;
 import org.apache.cxf.rs.security.oauth2.common.OAuthPermission;
 import org.apache.cxf.rs.security.oauth2.common.TokenIntrospection;
+import org.apache.cxf.rs.security.oauth2.common.UserSubject;
 import org.apache.cxf.rs.security.oauth2.provider.AccessTokenValidator;
 import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException;
 import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
@@ -87,7 +88,9 @@ public class AccessTokenIntrospectionClient implements AccessTokenValidator
{
             }
             atv.setTokenScopes(perms);
         }
-        
+        if (response.getUsername() != null) {
+            atv.setTokenSubject(new UserSubject(response.getUsername()));
+        }
         return atv;
     }
 


Mime
View raw message