Merge pull request #1320 from bverhoeven/rfc7662-sub

Client: Parse 'sub' key to identify resource owner in introspection response (RFC7662)
pull/1315/merge
Justin Richer 2018-05-03 14:46:49 -04:00 committed by GitHub
commit 9d6f42b141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -244,7 +244,10 @@ public class IntrospectingTokenService implements ResourceServerTokenServices {
private Authentication createUserAuthentication(JsonObject token) {
JsonElement userId = token.get("user_id");
if(userId == null) {
return null;
userId = token.get("sub");
if (userId == null) {
return null;
}
}
return new PreAuthenticatedAuthenticationToken(userId.getAsString(), token, introspectionAuthorityGranter.getAuthorities(token));