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();

View File

@ -39,24 +39,8 @@ public final class OAuth2AccessTokenResponse {
private OAuth2AccessTokenResponse() {
}
public String getTokenValue() {
return this.accessToken.getTokenValue();
}
public OAuth2AccessToken.TokenType getTokenType() {
return this.accessToken.getTokenType();
}
public Instant getIssuedAt() {
return this.accessToken.getIssuedAt();
}
public Instant getExpiresAt() {
return this.accessToken.getExpiresAt();
}
public Set<String> getScopes() {
return this.accessToken.getScopes();
public OAuth2AccessToken getAccessToken() {
return this.accessToken;
}
public Map<String, Object> getAdditionalParameters() {