override the correct part of the token granter class
parent
bdcc6af096
commit
510ddb48b7
|
@ -53,11 +53,10 @@ public class ChainedTokenGranter extends AbstractTokenGranter {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.springframework.security.oauth2.provider.token.AbstractTokenGranter#getAccessToken(org.springframework.security.oauth2.provider.AuthorizationRequest)
|
* @see org.springframework.security.oauth2.provider.token.AbstractTokenGranter#getOAuth2Authentication(org.springframework.security.oauth2.provider.AuthorizationRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected OAuth2AccessToken getAccessToken(AuthorizationRequest authorizationRequest) {
|
protected OAuth2Authentication getOAuth2Authentication(AuthorizationRequest authorizationRequest) {
|
||||||
|
|
||||||
// read and load up the existing token
|
// read and load up the existing token
|
||||||
String incomingTokenValue = authorizationRequest.getAuthorizationParameters().get("token");
|
String incomingTokenValue = authorizationRequest.getAuthorizationParameters().get("token");
|
||||||
OAuth2AccessTokenEntity incomingToken = tokenServices.readAccessToken(incomingTokenValue);
|
OAuth2AccessTokenEntity incomingToken = tokenServices.readAccessToken(incomingTokenValue);
|
||||||
|
@ -104,15 +103,12 @@ public class ChainedTokenGranter extends AbstractTokenGranter {
|
||||||
// create a new access token
|
// create a new access token
|
||||||
OAuth2Authentication authentication = new OAuth2Authentication(outgoingAuthRequest, incomingToken.getAuthenticationHolder().getAuthentication().getUserAuthentication());
|
OAuth2Authentication authentication = new OAuth2Authentication(outgoingAuthRequest, incomingToken.getAuthenticationHolder().getAuthentication().getUserAuthentication());
|
||||||
|
|
||||||
return tokenServices.createAccessToken(authentication);
|
return authentication;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidScopeException("Invalid scope requested in chained request", approvedScopes);
|
throw new InvalidScopeException("Invalid scope requested in chained request", approvedScopes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue