Class GoogleOAuthClientAuthenticationStrategyDelegate
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.GoogleOAuthClientAuthenticationStrategyDelegate
- All Implemented Interfaces:
AuthenticationStrategyDelegate
public class GoogleOAuthClientAuthenticationStrategyDelegate
extends AbstractOAuthClientAuthenticationStrategyDelegate
Maps
OAuth2AuthenticationToken from Google to OAuth2UserDetails. This
implementation overrides the default behavior of #buildUserRegistration to check that email
addresses have been verified before using them for registration.- Author:
- Cade Rea (cade-rea)
-
Constructor Summary
ConstructorsConstructorDescriptionGoogleOAuthClientAuthenticationStrategyDelegate(OAuth2UserDetailsService oAuth2UserDetailsService, UserRegistrationService<User> registrationService, AuthRegistrationProperties registrationProperties, AuthorizedClientService<AuthorizedClient> clientService, ClientIdentityProviderProperties clientProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, PasscodeService<PasswordToken, User> passcodeService) -
Method Summary
Modifier and TypeMethodDescriptionbuildUserRegistration(org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken authentication, String clientId, String username) Build aUserRegistrationfrom the authentication token.protected StringGets the registration type / client registration id that this delegate handlesMethods inherited from class com.broadleafcommerce.auth.client.web.authentication.session.AbstractOAuthClientAuthenticationStrategyDelegate
buildUsername, canHandle, getClientId, getEmail, getNameMethods inherited from class com.broadleafcommerce.auth.user.web.authentication.session.AbstractAuthenticationStrategyDelegate
generateRandomPassword, getAuthorizedClient, getClientProperties, getClientService, getOAuth2UserDetails, getOAuth2UserDetailsService, getPasscodeService, getRegistrationProperties, getRegistrationService, getTypeFactory, getUsername, getUserType, isAutoRegister, registerNewUser
-
Constructor Details
-
GoogleOAuthClientAuthenticationStrategyDelegate
public GoogleOAuthClientAuthenticationStrategyDelegate(OAuth2UserDetailsService oAuth2UserDetailsService, UserRegistrationService<User> registrationService, AuthRegistrationProperties registrationProperties, AuthorizedClientService<AuthorizedClient> clientService, ClientIdentityProviderProperties clientProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, PasscodeService<PasswordToken, User> passcodeService)
-
-
Method Details
-
getOAuthRegistrationType
Description copied from class:AbstractOAuthClientAuthenticationStrategyDelegateGets the registration type / client registration id that this delegate handles- Specified by:
getOAuthRegistrationTypein classAbstractOAuthClientAuthenticationStrategyDelegate- Returns:
- supported registration type
-
buildUserRegistration
public UserRegistration buildUserRegistration(org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken authentication, String clientId, String username) Description copied from class:AbstractAuthenticationStrategyDelegateBuild aUserRegistrationfrom the authentication token.- Overrides:
buildUserRegistrationin classAbstractAuthenticationStrategyDelegate<org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken>- Parameters:
authentication- The user'sAuthentication.clientId- The ID of the client authenticated withusername- The username of the user- Returns:
- The
UserRegistrationfor the user.
-