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.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));
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue