parent
8032baa296
commit
b496ad4d86
|
@ -124,10 +124,10 @@ public class OAuth2LoginAuthenticationProvider implements AuthenticationProvider
|
||||||
this.authoritiesMapper.mapAuthorities(oauth2User.getAuthorities());
|
this.authoritiesMapper.mapAuthorities(oauth2User.getAuthorities());
|
||||||
|
|
||||||
OAuth2LoginAuthenticationToken authenticationResult = new OAuth2LoginAuthenticationToken(
|
OAuth2LoginAuthenticationToken authenticationResult = new OAuth2LoginAuthenticationToken(
|
||||||
oauth2User,
|
|
||||||
mappedAuthorities,
|
|
||||||
authorizationCodeAuthentication.getClientRegistration(),
|
authorizationCodeAuthentication.getClientRegistration(),
|
||||||
authorizationCodeAuthentication.getAuthorizationExchange(),
|
authorizationCodeAuthentication.getAuthorizationExchange(),
|
||||||
|
oauth2User,
|
||||||
|
mappedAuthorities,
|
||||||
accessToken);
|
accessToken);
|
||||||
authenticationResult.setDetails(authorizationCodeAuthentication.getDetails());
|
authenticationResult.setDetails(authorizationCodeAuthentication.getDetails());
|
||||||
|
|
||||||
|
|
|
@ -69,25 +69,25 @@ public class OAuth2LoginAuthenticationToken extends AbstractAuthenticationToken
|
||||||
* which indicates that the Authorization Code Grant flow has fully completed
|
* which indicates that the Authorization Code Grant flow has fully completed
|
||||||
* and OAuth 2.0 Login has been achieved.
|
* and OAuth 2.0 Login has been achieved.
|
||||||
*
|
*
|
||||||
* @param principal
|
|
||||||
* @param authorities
|
|
||||||
* @param clientRegistration
|
* @param clientRegistration
|
||||||
* @param authorizationExchange
|
* @param authorizationExchange
|
||||||
|
* @param principal
|
||||||
|
* @param authorities
|
||||||
* @param accessToken
|
* @param accessToken
|
||||||
*/
|
*/
|
||||||
public OAuth2LoginAuthenticationToken(OAuth2User principal,
|
public OAuth2LoginAuthenticationToken(ClientRegistration clientRegistration,
|
||||||
Collection<? extends GrantedAuthority> authorities,
|
|
||||||
ClientRegistration clientRegistration,
|
|
||||||
OAuth2AuthorizationExchange authorizationExchange,
|
OAuth2AuthorizationExchange authorizationExchange,
|
||||||
|
OAuth2User principal,
|
||||||
|
Collection<? extends GrantedAuthority> authorities,
|
||||||
OAuth2AccessToken accessToken) {
|
OAuth2AccessToken accessToken) {
|
||||||
super(authorities);
|
super(authorities);
|
||||||
Assert.notNull(principal, "principal cannot be null");
|
|
||||||
Assert.notNull(clientRegistration, "clientRegistration cannot be null");
|
Assert.notNull(clientRegistration, "clientRegistration cannot be null");
|
||||||
Assert.notNull(authorizationExchange, "authorizationExchange cannot be null");
|
Assert.notNull(authorizationExchange, "authorizationExchange cannot be null");
|
||||||
|
Assert.notNull(principal, "principal cannot be null");
|
||||||
Assert.notNull(accessToken, "accessToken cannot be null");
|
Assert.notNull(accessToken, "accessToken cannot be null");
|
||||||
this.principal = principal;
|
|
||||||
this.clientRegistration = clientRegistration;
|
this.clientRegistration = clientRegistration;
|
||||||
this.authorizationExchange = authorizationExchange;
|
this.authorizationExchange = authorizationExchange;
|
||||||
|
this.principal = principal;
|
||||||
this.accessToken = accessToken;
|
this.accessToken = accessToken;
|
||||||
this.setAuthenticated(true);
|
this.setAuthenticated(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,10 +159,10 @@ public class OidcAuthorizationCodeAuthenticationProvider implements Authenticati
|
||||||
this.authoritiesMapper.mapAuthorities(oidcUser.getAuthorities());
|
this.authoritiesMapper.mapAuthorities(oidcUser.getAuthorities());
|
||||||
|
|
||||||
OidcAuthorizationCodeAuthenticationToken authenticationResult = new OidcAuthorizationCodeAuthenticationToken(
|
OidcAuthorizationCodeAuthenticationToken authenticationResult = new OidcAuthorizationCodeAuthenticationToken(
|
||||||
oidcUser,
|
|
||||||
mappedAuthorities,
|
|
||||||
authorizationCodeAuthentication.getClientRegistration(),
|
authorizationCodeAuthentication.getClientRegistration(),
|
||||||
authorizationCodeAuthentication.getAuthorizationExchange(),
|
authorizationCodeAuthentication.getAuthorizationExchange(),
|
||||||
|
oidcUser,
|
||||||
|
mappedAuthorities,
|
||||||
accessToken,
|
accessToken,
|
||||||
idToken);
|
idToken);
|
||||||
authenticationResult.setDetails(authorizationCodeAuthentication.getDetails());
|
authenticationResult.setDetails(authorizationCodeAuthentication.getDetails());
|
||||||
|
|
|
@ -56,21 +56,21 @@ public class OidcAuthorizationCodeAuthenticationToken extends OAuth2LoginAuthent
|
||||||
* which indicates that the Authorization Code Flow has fully completed
|
* which indicates that the Authorization Code Flow has fully completed
|
||||||
* and OpenID Connect 1.0 Authentication has been achieved.
|
* and OpenID Connect 1.0 Authentication has been achieved.
|
||||||
*
|
*
|
||||||
* @param principal
|
|
||||||
* @param authorities
|
|
||||||
* @param clientRegistration
|
* @param clientRegistration
|
||||||
* @param authorizationExchange
|
* @param authorizationExchange
|
||||||
|
* @param principal
|
||||||
|
* @param authorities
|
||||||
* @param accessToken
|
* @param accessToken
|
||||||
* @param idToken
|
* @param idToken
|
||||||
*/
|
*/
|
||||||
public OidcAuthorizationCodeAuthenticationToken(OidcUser principal,
|
public OidcAuthorizationCodeAuthenticationToken(ClientRegistration clientRegistration,
|
||||||
Collection<? extends GrantedAuthority> authorities,
|
|
||||||
ClientRegistration clientRegistration,
|
|
||||||
OAuth2AuthorizationExchange authorizationExchange,
|
OAuth2AuthorizationExchange authorizationExchange,
|
||||||
|
OidcUser principal,
|
||||||
|
Collection<? extends GrantedAuthority> authorities,
|
||||||
OAuth2AccessToken accessToken,
|
OAuth2AccessToken accessToken,
|
||||||
OidcIdToken idToken) {
|
OidcIdToken idToken) {
|
||||||
|
|
||||||
super(principal, authorities, clientRegistration, authorizationExchange, accessToken);
|
super(clientRegistration, authorizationExchange, principal, authorities, accessToken);
|
||||||
Assert.notNull(idToken, "idToken cannot be null");
|
Assert.notNull(idToken, "idToken cannot be null");
|
||||||
this.idToken = idToken;
|
this.idToken = idToken;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue