OAuth2AuthorizationResponse getAccessToken

No longer delegate to OAuth2AccessToken but add getAccessToken()

Fixes gh-4743
This commit is contained in:
Rob Winch
2017-10-29 17:12:46 -05:00
parent e4887057bc
commit f0c2944377
3 changed files with 4 additions and 24 deletions

View File

@@ -115,9 +115,7 @@ public class OAuth2LoginAuthenticationProvider implements AuthenticationProvider
authorizationCodeAuthentication.getClientRegistration(),
authorizationCodeAuthentication.getAuthorizationExchange()));
OAuth2AccessToken accessToken = new OAuth2AccessToken(accessTokenResponse.getTokenType(),
accessTokenResponse.getTokenValue(), accessTokenResponse.getIssuedAt(),
accessTokenResponse.getExpiresAt(), accessTokenResponse.getScopes());
OAuth2AccessToken accessToken = accessTokenResponse.getAccessToken();
OAuth2User oauth2User = this.userService.loadUser(
new OAuth2UserRequest(authorizationCodeAuthentication.getClientRegistration(), accessToken));

View File

@@ -133,9 +133,7 @@ public class OidcAuthorizationCodeAuthenticationProvider implements Authenticati
authorizationCodeAuthentication.getClientRegistration(),
authorizationCodeAuthentication.getAuthorizationExchange()));
OAuth2AccessToken accessToken = new OAuth2AccessToken(accessTokenResponse.getTokenType(),
accessTokenResponse.getTokenValue(), accessTokenResponse.getIssuedAt(),
accessTokenResponse.getExpiresAt(), accessTokenResponse.getScopes());
OAuth2AccessToken accessToken = accessTokenResponse.getAccessToken();
ClientRegistration clientRegistration = authorizationCodeAuthentication.getClientRegistration();