Class DefaultOIDCAuthenticationStrategyDelegate
java.lang.Object
com.broadleafcommerce.auth.user.web.authentication.session.AbstractAuthenticationStrategyDelegate<org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken>
com.broadleafcommerce.auth.client.web.authentication.session.AbstractOAuthClientAuthenticationStrategyDelegate
com.broadleafcommerce.auth.client.web.authentication.session.DefaultOIDCAuthenticationStrategyDelegate
- All Implemented Interfaces:
AuthenticationStrategyDelegate
public class DefaultOIDCAuthenticationStrategyDelegate
extends AbstractOAuthClientAuthenticationStrategyDelegate
Basic implementation that will try to handle any
OAuth2AuthenticationToken
. Marked with
@Order(LOWEST_PRECEDENCE)
to ensure this will always be the last
AuthenticationStrategyDelegate
in the list.- Author:
- Cade Rea (cade-rea)
-
Constructor Summary
ConstructorDescriptionDefaultOIDCAuthenticationStrategyDelegate
(OAuth2UserDetailsService oAuth2UserDetailsService, UserRegistrationService<User> registrationService, AuthRegistrationProperties registrationProperties, AuthorizedClientService<AuthorizedClient> clientService, ClientIdentityProviderProperties clientProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, PasswordGenerator passwordGenerator) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandle
(@NonNull org.springframework.security.core.Authentication authentication) Check if the given Authentication is anOAuth2AuthenticationToken
and the registration id matchesAbstractOAuthClientAuthenticationStrategyDelegate.getOAuthRegistrationType()
protected String
Gets the registration type / client registration id that this delegate handlesMethods inherited from class com.broadleafcommerce.auth.client.web.authentication.session.AbstractOAuthClientAuthenticationStrategyDelegate
buildUsername, getClientId, getEmail, getName
Methods inherited from class com.broadleafcommerce.auth.user.web.authentication.session.AbstractAuthenticationStrategyDelegate
buildUserRegistration, generateRandomPassword, getAuthorizedClient, getClientProperties, getClientService, getOAuth2UserDetails, getOAuth2UserDetailsService, getPasswordGenerator, getRegistrationProperties, getRegistrationService, getTypeFactory, getUsername, getUserType, isAutoRegister, registerNewUser
-
Constructor Details
-
DefaultOIDCAuthenticationStrategyDelegate
public DefaultOIDCAuthenticationStrategyDelegate(OAuth2UserDetailsService oAuth2UserDetailsService, UserRegistrationService<User> registrationService, AuthRegistrationProperties registrationProperties, AuthorizedClientService<AuthorizedClient> clientService, ClientIdentityProviderProperties clientProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, PasswordGenerator passwordGenerator)
-
-
Method Details
-
canHandle
public boolean canHandle(@NonNull @NonNull org.springframework.security.core.Authentication authentication) Description copied from class:AbstractOAuthClientAuthenticationStrategyDelegate
Check if the given Authentication is anOAuth2AuthenticationToken
and the registration id matchesAbstractOAuthClientAuthenticationStrategyDelegate.getOAuthRegistrationType()
- Specified by:
canHandle
in interfaceAuthenticationStrategyDelegate
- Overrides:
canHandle
in classAbstractOAuthClientAuthenticationStrategyDelegate
- Parameters:
authentication
- The authentication token- Returns:
- Whether this delegate can map the token to an OAuth2UserDetails
-
getOAuthRegistrationType
Description copied from class:AbstractOAuthClientAuthenticationStrategyDelegate
Gets the registration type / client registration id that this delegate handles- Specified by:
getOAuthRegistrationType
in classAbstractOAuthClientAuthenticationStrategyDelegate
- Returns:
- supported registration type
-