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
MapsOAuth2AuthenticationToken
from Google toOAuth2UserDetails
. 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
Constructors Constructor Description GoogleOAuthClientAuthenticationStrategyDelegate(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 UserRegistration
buildUserRegistration(org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken authentication, String clientId, String username)
Build aUserRegistration
from the authentication token.protected String
getOAuthRegistrationType()
Gets the registration type / client registration id that this delegate handles-
Methods inherited from class com.broadleafcommerce.auth.client.web.authentication.session.AbstractOAuthClientAuthenticationStrategyDelegate
buildUsername, canHandle, getClientId, getEmail, getName
-
Methods 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 Detail
-
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 Detail
-
getOAuthRegistrationType
protected String 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
-
buildUserRegistration
public UserRegistration buildUserRegistration(org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken authentication, String clientId, String username)
Description copied from class:AbstractAuthenticationStrategyDelegate
Build aUserRegistration
from the authentication token.- Overrides:
buildUserRegistration
in 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
UserRegistration
for the user.
-
-