public class ProviderLoginSupportImpl extends Object implements ProviderLoginSupport
ProviderLoginSupport. On complete(String, String, HttpServletRequest), if the
user data of the provider connection corresponds to an existing Crafter Profile user, the profile connection data
will be updated. If a profile doesn't exist, a new one with the connection data will be created. In both cases, the
user is automatically authenticated with Crafter Profile.| Modifier and Type | Field and Description |
|---|---|
protected AuthenticationManager |
authenticationManager |
protected org.springframework.social.connect.ConnectionFactoryLocator |
connectionFactoryLocator |
protected org.springframework.social.connect.web.ConnectSupport |
connectSupport |
static String |
PARAM_CODE |
static String |
PARAM_ERROR |
static String |
PARAM_ERROR_DESCRIPTION |
static String |
PARAM_ERROR_URI |
static String |
PARAM_OAUTH_TOKEN |
protected ProfileService |
profileService |
protected org.craftercms.commons.crypto.TextEncryptor |
textEncryptor |
| Constructor and Description |
|---|
ProviderLoginSupportImpl() |
| Modifier and Type | Method and Description |
|---|---|
Authentication |
complete(String tenant,
String providerId,
javax.servlet.http.HttpServletRequest request)
Completes the OAuth authentication, returning the resulting
Authentication object, or null if it
couldn't be completed. |
Authentication |
complete(String tenant,
String providerId,
javax.servlet.http.HttpServletRequest request,
Set<String> newUserRoles,
Map<String,Object> newUserAttributes)
Completes the OAuth authentication, returning the resulting
Authentication object, or null if it
couldn't be completed. |
Authentication |
complete(String tenant,
String providerId,
javax.servlet.http.HttpServletRequest request,
Set<String> newUserRoles,
Map<String,Object> newUserAttributes,
org.springframework.social.connect.web.ConnectSupport connectSupport)
Completes the OAuth authentication, returning the resulting
Authentication object, or null if it
couldn't be completed. |
protected org.springframework.social.connect.Connection<?> |
completeConnection(org.springframework.social.connect.web.ConnectSupport connectSupport,
String providerId,
javax.servlet.http.HttpServletRequest request) |
protected Profile |
createProfile(String tenant,
org.springframework.social.connect.Connection<?> connection,
Profile userData) |
protected org.springframework.social.connect.ConnectionFactory<?> |
getConnectionFactory(String providerId) |
protected Profile |
getProfile(String tenant,
Profile userData) |
void |
setAuthenticationManager(AuthenticationManager authenticationManager) |
void |
setConnectionFactoryLocator(org.springframework.social.connect.ConnectionFactoryLocator connectionFactoryLocator) |
void |
setConnectSupport(org.springframework.social.connect.web.ConnectSupport connectSupport) |
void |
setProfileService(ProfileService profileService) |
void |
setTextEncryptor(org.craftercms.commons.crypto.TextEncryptor textEncryptor) |
String |
start(String tenant,
String providerId,
javax.servlet.http.HttpServletRequest request)
Starts the OAuth login process.
|
String |
start(String tenant,
String providerId,
javax.servlet.http.HttpServletRequest request,
org.springframework.util.MultiValueMap<String,String> additionalUrlParams)
Starts the OAuth login process.
|
String |
start(String tenant,
String providerId,
javax.servlet.http.HttpServletRequest request,
org.springframework.util.MultiValueMap<String,String> additionalUrlParams,
org.springframework.social.connect.web.ConnectSupport connectSupport)
Starts the OAuth login process.
|
protected Profile |
updateProfileConnectionData(String tenant,
org.springframework.social.connect.Connection<?> connection,
Profile profile) |
public static final String PARAM_OAUTH_TOKEN
public static final String PARAM_CODE
public static final String PARAM_ERROR
public static final String PARAM_ERROR_DESCRIPTION
public static final String PARAM_ERROR_URI
protected org.springframework.social.connect.web.ConnectSupport connectSupport
protected org.springframework.social.connect.ConnectionFactoryLocator connectionFactoryLocator
protected ProfileService profileService
protected AuthenticationManager authenticationManager
protected org.craftercms.commons.crypto.TextEncryptor textEncryptor
public void setConnectSupport(org.springframework.social.connect.web.ConnectSupport connectSupport)
public void setConnectionFactoryLocator(org.springframework.social.connect.ConnectionFactoryLocator connectionFactoryLocator)
public void setProfileService(ProfileService profileService)
public void setAuthenticationManager(AuthenticationManager authenticationManager)
public void setTextEncryptor(org.craftercms.commons.crypto.TextEncryptor textEncryptor)
public String start(String tenant, String providerId, javax.servlet.http.HttpServletRequest request) throws AuthenticationException
ProviderLoginSupportstart in interface ProviderLoginSupporttenant - the current tenant the authenticated user belongs tooproviderId - the social service provider ID: facebook, twitter, linkedinrequest - the current requestAuthenticationExceptionpublic String start(String tenant, String providerId, javax.servlet.http.HttpServletRequest request, org.springframework.util.MultiValueMap<String,String> additionalUrlParams) throws AuthenticationException
ProviderLoginSupportstart in interface ProviderLoginSupporttenant - the current tenant the authenticated user belongs tooproviderId - the social service provider ID: facebook, twitter, linkedinrequest - the current requestadditionalUrlParams - additional parameters that should be added to the redirect URLAuthenticationExceptionpublic String start(String tenant, String providerId, javax.servlet.http.HttpServletRequest request, org.springframework.util.MultiValueMap<String,String> additionalUrlParams, org.springframework.social.connect.web.ConnectSupport connectSupport) throws AuthenticationException
ProviderLoginSupportstart in interface ProviderLoginSupporttenant - the current tenant the authenticated user belongs tooproviderId - the social service provider ID: facebook, twitter, linkedinrequest - the current requestadditionalUrlParams - additional parameters that should be added to the redirect URLconnectSupport - helper class instance for establishing the connections with the providersAuthenticationExceptionpublic Authentication complete(String tenant, String providerId, javax.servlet.http.HttpServletRequest request) throws AuthenticationException
ProviderLoginSupportAuthentication object, or null if it
couldn't be completed.complete in interface ProviderLoginSupporttenant - the current tenant the authenticated user belongs tooproviderId - the social service provider ID: facebook, twitter, linkedinrequest - the current requestAuthenticationExceptionpublic Authentication complete(String tenant, String providerId, javax.servlet.http.HttpServletRequest request, Set<String> newUserRoles, Map<String,Object> newUserAttributes) throws AuthenticationException
ProviderLoginSupportAuthentication object, or null if it
couldn't be completed.complete in interface ProviderLoginSupporttenant - the current tenant the authenticated user belongs tooproviderId - the social service provider ID: facebook, twitter, linkedinrequest - the current requestnewUserRoles - roles to add to a new usernewUserAttributes - attributes to add to a new userAuthenticationExceptionpublic Authentication complete(String tenant, String providerId, javax.servlet.http.HttpServletRequest request, Set<String> newUserRoles, Map<String,Object> newUserAttributes, org.springframework.social.connect.web.ConnectSupport connectSupport) throws AuthenticationException
ProviderLoginSupportAuthentication object, or null if it
couldn't be completed.complete in interface ProviderLoginSupporttenant - the current tenant the authenticated user belongs tooproviderId - the social service provider ID: facebook, twitter, linkedinrequest - the current requestnewUserRoles - roles to add to a new usernewUserAttributes - attributes to add to a new userconnectSupport - helper class instance for establishing the connections with the providersAuthenticationExceptionprotected org.springframework.social.connect.Connection<?> completeConnection(org.springframework.social.connect.web.ConnectSupport connectSupport,
String providerId,
javax.servlet.http.HttpServletRequest request)
throws OAuth2Exception
OAuth2Exceptionprotected org.springframework.social.connect.ConnectionFactory<?> getConnectionFactory(String providerId)
protected Profile createProfile(String tenant, org.springframework.social.connect.Connection<?> connection, Profile userData)
Copyright © 2023 CrafterCMS. All rights reserved.