Class GithubOAuthClientAuthenticationStrategyDelegate
- 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.GithubOAuthClientAuthenticationStrategyDelegate
-
- All Implemented Interfaces:
AuthenticationStrategyDelegate
public class GithubOAuthClientAuthenticationStrategyDelegate extends AbstractOAuthClientAuthenticationStrategyDelegate
MapsOAuth2AuthenticationToken
from Github toOAuth2UserDetails
. This implementation overrides the default behavior of #getEmail, since github users can opt out of sharing their email address.- Author:
- Cade Rea (cade-rea)
-
-
Constructor Summary
Constructors Constructor Description GithubOAuthClientAuthenticationStrategyDelegate(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 protected String
getEmail(org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken authentication)
Get the user's email address 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, 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
-
GithubOAuthClientAuthenticationStrategyDelegate
public GithubOAuthClientAuthenticationStrategyDelegate(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
-
getEmail
protected String getEmail(org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken authentication)
Description copied from class:AbstractAuthenticationStrategyDelegate
Get the user's email address from the authentication token.- Overrides:
getEmail
in classAbstractOAuthClientAuthenticationStrategyDelegate
- Returns:
-
-