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 anyOAuth2AuthenticationToken. Marked with@Order(LOWEST_PRECEDENCE)to ensure this will always be the lastAuthenticationStrategyDelegatein the list.- Author:
- Cade Rea (cade-rea)
-
-
Constructor Summary
Constructors Constructor Description DefaultOIDCAuthenticationStrategyDelegate(OAuth2UserDetailsService oAuth2UserDetailsService, UserRegistrationService<User> registrationService, AuthRegistrationProperties registrationProperties, AuthorizedClientService<AuthorizedClient> clientService, ClientIdentityProviderProperties clientProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, PasscodeService<PasswordToken,User> passcodeService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(@NonNull org.springframework.security.core.Authentication authentication)Check if the given Authentication is anOAuth2AuthenticationTokenand the registration id matchesAbstractOAuthClientAuthenticationStrategyDelegate.getOAuthRegistrationType()protected StringgetOAuthRegistrationType()Gets the registration type / client registration id that this delegate handles-
Methods 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, getPasscodeService, getRegistrationProperties, getRegistrationService, getTypeFactory, getUsername, getUserType, isAutoRegister, registerNewUser
-
-
-
-
Constructor Detail
-
DefaultOIDCAuthenticationStrategyDelegate
public DefaultOIDCAuthenticationStrategyDelegate(OAuth2UserDetailsService oAuth2UserDetailsService, UserRegistrationService<User> registrationService, AuthRegistrationProperties registrationProperties, AuthorizedClientService<AuthorizedClient> clientService, ClientIdentityProviderProperties clientProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, PasscodeService<PasswordToken,User> passcodeService)
-
-
Method Detail
-
canHandle
public boolean canHandle(@NonNull @NonNull org.springframework.security.core.Authentication authentication)Description copied from class:AbstractOAuthClientAuthenticationStrategyDelegateCheck if the given Authentication is anOAuth2AuthenticationTokenand the registration id matchesAbstractOAuthClientAuthenticationStrategyDelegate.getOAuthRegistrationType()- Specified by:
canHandlein interfaceAuthenticationStrategyDelegate- Overrides:
canHandlein classAbstractOAuthClientAuthenticationStrategyDelegate- Parameters:
authentication- The authentication token- Returns:
- Whether this delegate can map the token to an OAuth2UserDetails
-
getOAuthRegistrationType
protected String getOAuthRegistrationType()
Description copied from class:AbstractOAuthClientAuthenticationStrategyDelegateGets the registration type / client registration id that this delegate handles- Specified by:
getOAuthRegistrationTypein classAbstractOAuthClientAuthenticationStrategyDelegate- Returns:
- supported registration type
-
-