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.getClientRegistration(),
authorizationCodeAuthentication.getAuthorizationExchange())); authorizationCodeAuthentication.getAuthorizationExchange()));
OAuth2AccessToken accessToken = new OAuth2AccessToken(accessTokenResponse.getTokenType(), OAuth2AccessToken accessToken = accessTokenResponse.getAccessToken();
accessTokenResponse.getTokenValue(), accessTokenResponse.getIssuedAt(),
accessTokenResponse.getExpiresAt(), accessTokenResponse.getScopes());
OAuth2User oauth2User = this.userService.loadUser( OAuth2User oauth2User = this.userService.loadUser(
new OAuth2UserRequest(authorizationCodeAuthentication.getClientRegistration(), accessToken)); new OAuth2UserRequest(authorizationCodeAuthentication.getClientRegistration(), accessToken));

View File

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

View File

@ -39,24 +39,8 @@ public final class OAuth2AccessTokenResponse {
private OAuth2AccessTokenResponse() { private OAuth2AccessTokenResponse() {
} }
public String getTokenValue() { public OAuth2AccessToken getAccessToken() {
return this.accessToken.getTokenValue(); return this.accessToken;
}
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 Map<String, Object> getAdditionalParameters() { public Map<String, Object> getAdditionalParameters() {