Merge pull request #263 from ssayer/introspection-fix

fixed typos and dumbness in introspection endpoint filter thingy
pull/306/merge
Justin Richer 2013-02-01 09:04:23 -08:00
commit a6ca7cb31b
1 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ public class IntrospectingTokenService implements ResourceServerTokenServices {
// create a default authentication object with authority ROLE_API // create a default authentication object with authority ROLE_API
private Authentication createAuthentication(JsonObject token){ private Authentication createAuthentication(JsonObject token){
// TODO: user_id is going to go away. Will have to fix. // TODO: user_id is going to go away. Will have to fix.
return new PreAuthenticatedAuthenticationToken(token.get("sub").getAsString(), null, AuthorityUtils.createAuthorityList("ROLE_API")); return new PreAuthenticatedAuthenticationToken(token.get("subject").getAsString(), null, AuthorityUtils.createAuthorityList("ROLE_API"));
} }
private OAuth2AccessToken createAccessToken(final JsonObject token, final String tokenString){ private OAuth2AccessToken createAccessToken(final JsonObject token, final String tokenString){
@ -140,7 +140,7 @@ public class IntrospectingTokenService implements ResourceServerTokenServices {
return false; return false;
} }
// create an OAuth2Authentication // create an OAuth2Authentication
OAuth2Authentication auth = new OAuth2Authentication(createAuthRequest(tokenResponse), null); OAuth2Authentication auth = new OAuth2Authentication(createAuthRequest(tokenResponse), createAuthentication(tokenResponse));
// create an OAuth2AccessToken // create an OAuth2AccessToken
OAuth2AccessToken token = createAccessToken(tokenResponse, accessToken); OAuth2AccessToken token = createAccessToken(tokenResponse, accessToken);