OAuth2AuthorizationResponse getAccessToken
No longer delegate to OAuth2AccessToken but add getAccessToken() Fixes gh-4743
This commit is contained in:
parent
e4887057bc
commit
f0c2944377
|
@ -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));
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue