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
ConstructorDescriptionGoogleOAuthClientAuthenticationStrategyDelegate
(OAuth2UserDetailsService oAuth2UserDetailsService, UserRegistrationService<User> registrationService, AuthRegistrationProperties registrationProperties, AuthorizedClientService<AuthorizedClient> clientService, ClientIdentityProviderProperties clientProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, PasswordGenerator passwordGenerator) -
Method Summary
Modifier and TypeMethodDescriptionbuildUserRegistration
(org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken authentication, String clientId, String username) Build aUserRegistration
from the authentication token.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, canHandle, getClientId, getEmail, getName
Methods inherited from class com.broadleafcommerce.auth.user.web.authentication.session.AbstractAuthenticationStrategyDelegate
generateRandomPassword, getAuthorizedClient, getClientProperties, getClientService, getOAuth2UserDetails, getOAuth2UserDetailsService, getPasswordGenerator, 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, PasswordGenerator passwordGenerator)
-
-
Method Details
-
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.
-