Class ProviderLoginSupportImpl
- java.lang.Object
- 
- org.craftercms.security.social.impl.ProviderLoginSupportImpl
 
- 
- All Implemented Interfaces:
- ProviderLoginSupport
 
 public class ProviderLoginSupportImpl extends Object implements ProviderLoginSupport Default implementation ofProviderLoginSupport. Oncomplete(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.- Author:
- avasquez
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected AuthenticationManagerauthenticationManagerprotected org.springframework.social.connect.ConnectionFactoryLocatorconnectionFactoryLocatorprotected org.springframework.social.connect.web.ConnectSupportconnectSupportstatic StringPARAM_CODEstatic StringPARAM_ERRORstatic StringPARAM_ERROR_DESCRIPTIONstatic StringPARAM_ERROR_URIstatic StringPARAM_OAUTH_TOKENprotected ProfileServiceprofileServiceprotected org.craftercms.commons.crypto.TextEncryptortextEncryptor
 - 
Constructor SummaryConstructors Constructor Description ProviderLoginSupportImpl()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Authenticationcomplete(String tenant, String providerId, javax.servlet.http.HttpServletRequest request)Completes the OAuth authentication, returning the resultingAuthenticationobject, or null if it couldn't be completed.Authenticationcomplete(String tenant, String providerId, javax.servlet.http.HttpServletRequest request, Set<String> newUserRoles, Map<String,Object> newUserAttributes)Completes the OAuth authentication, returning the resultingAuthenticationobject, or null if it couldn't be completed.Authenticationcomplete(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 resultingAuthenticationobject, 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 ProfilecreateProfile(String tenant, org.springframework.social.connect.Connection<?> connection, Profile userData)protected org.springframework.social.connect.ConnectionFactory<?>getConnectionFactory(String providerId)protected ProfilegetProfile(String tenant, Profile userData)voidsetAuthenticationManager(AuthenticationManager authenticationManager)voidsetConnectionFactoryLocator(org.springframework.social.connect.ConnectionFactoryLocator connectionFactoryLocator)voidsetConnectSupport(org.springframework.social.connect.web.ConnectSupport connectSupport)voidsetProfileService(ProfileService profileService)voidsetTextEncryptor(org.craftercms.commons.crypto.TextEncryptor textEncryptor)Stringstart(String tenant, String providerId, javax.servlet.http.HttpServletRequest request)Starts the OAuth login process.Stringstart(String tenant, String providerId, javax.servlet.http.HttpServletRequest request, org.springframework.util.MultiValueMap<String,String> additionalUrlParams)Starts the OAuth login process.Stringstart(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 ProfileupdateProfileConnectionData(String tenant, org.springframework.social.connect.Connection<?> connection, Profile profile)
 
- 
- 
- 
Field Detail- 
PARAM_OAUTH_TOKENpublic static final String PARAM_OAUTH_TOKEN - See Also:
- Constant Field Values
 
 - 
PARAM_CODEpublic static final String PARAM_CODE - See Also:
- Constant Field Values
 
 - 
PARAM_ERRORpublic static final String PARAM_ERROR - See Also:
- Constant Field Values
 
 - 
PARAM_ERROR_DESCRIPTIONpublic static final String PARAM_ERROR_DESCRIPTION - See Also:
- Constant Field Values
 
 - 
PARAM_ERROR_URIpublic static final String PARAM_ERROR_URI - See Also:
- Constant Field Values
 
 - 
connectSupportprotected org.springframework.social.connect.web.ConnectSupport connectSupport 
 - 
connectionFactoryLocatorprotected org.springframework.social.connect.ConnectionFactoryLocator connectionFactoryLocator 
 - 
profileServiceprotected ProfileService profileService 
 - 
authenticationManagerprotected AuthenticationManager authenticationManager 
 - 
textEncryptorprotected org.craftercms.commons.crypto.TextEncryptor textEncryptor 
 
- 
 - 
Method Detail- 
setConnectSupportpublic void setConnectSupport(org.springframework.social.connect.web.ConnectSupport connectSupport) 
 - 
setConnectionFactoryLocatorpublic void setConnectionFactoryLocator(org.springframework.social.connect.ConnectionFactoryLocator connectionFactoryLocator) 
 - 
setProfileServicepublic void setProfileService(ProfileService profileService) 
 - 
setAuthenticationManagerpublic void setAuthenticationManager(AuthenticationManager authenticationManager) 
 - 
setTextEncryptorpublic void setTextEncryptor(org.craftercms.commons.crypto.TextEncryptor textEncryptor) 
 - 
startpublic String start(String tenant, String providerId, javax.servlet.http.HttpServletRequest request) throws AuthenticationException Description copied from interface:ProviderLoginSupportStarts the OAuth login process. Returns a URL that the app should redirect to.- Specified by:
- startin interface- ProviderLoginSupport
- Parameters:
- tenant- the current tenant the authenticated user belongs too
- providerId- the social service provider ID: facebook, twitter, linkedin
- request- the current request
- Returns:
- the provider specific URL the current app should redirect too.
- Throws:
- AuthenticationException
 
 - 
startpublic String start(String tenant, String providerId, javax.servlet.http.HttpServletRequest request, org.springframework.util.MultiValueMap<String,String> additionalUrlParams) throws AuthenticationException Description copied from interface:ProviderLoginSupportStarts the OAuth login process. Returns a URL that the app should redirect to.- Specified by:
- startin interface- ProviderLoginSupport
- Parameters:
- tenant- the current tenant the authenticated user belongs too
- providerId- the social service provider ID: facebook, twitter, linkedin
- request- the current request
- additionalUrlParams- additional parameters that should be added to the redirect URL
- Returns:
- the provider specific URL the current app should redirect too.
- Throws:
- AuthenticationException
 
 - 
startpublic 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 Description copied from interface:ProviderLoginSupportStarts the OAuth login process. Returns a URL that the app should redirect to.- Specified by:
- startin interface- ProviderLoginSupport
- Parameters:
- tenant- the current tenant the authenticated user belongs too
- providerId- the social service provider ID: facebook, twitter, linkedin
- request- the current request
- additionalUrlParams- additional parameters that should be added to the redirect URL
- connectSupport- helper class instance for establishing the connections with the providers
- Returns:
- the provider specific URL the current app should redirect too.
- Throws:
- AuthenticationException
 
 - 
completepublic Authentication complete(String tenant, String providerId, javax.servlet.http.HttpServletRequest request) throws AuthenticationException Description copied from interface:ProviderLoginSupportCompletes the OAuth authentication, returning the resultingAuthenticationobject, or null if it couldn't be completed.- Specified by:
- completein interface- ProviderLoginSupport
- Parameters:
- tenant- the current tenant the authenticated user belongs too
- providerId- the social service provider ID: facebook, twitter, linkedin
- request- the current request
- Returns:
- the authentication
- Throws:
- AuthenticationException
 
 - 
completepublic Authentication complete(String tenant, String providerId, javax.servlet.http.HttpServletRequest request, Set<String> newUserRoles, Map<String,Object> newUserAttributes) throws AuthenticationException Description copied from interface:ProviderLoginSupportCompletes the OAuth authentication, returning the resultingAuthenticationobject, or null if it couldn't be completed.- Specified by:
- completein interface- ProviderLoginSupport
- Parameters:
- tenant- the current tenant the authenticated user belongs too
- providerId- the social service provider ID: facebook, twitter, linkedin
- request- the current request
- newUserRoles- roles to add to a new user
- newUserAttributes- attributes to add to a new user
- Returns:
- the authentication
- Throws:
- AuthenticationException
 
 - 
completepublic 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 Description copied from interface:ProviderLoginSupportCompletes the OAuth authentication, returning the resultingAuthenticationobject, or null if it couldn't be completed.- Specified by:
- completein interface- ProviderLoginSupport
- Parameters:
- tenant- the current tenant the authenticated user belongs too
- providerId- the social service provider ID: facebook, twitter, linkedin
- request- the current request
- newUserRoles- roles to add to a new user
- newUserAttributes- attributes to add to a new user
- connectSupport- helper class instance for establishing the connections with the providers
- Returns:
- the authentication
- Throws:
- AuthenticationException
 
 - 
completeConnectionprotected org.springframework.social.connect.Connection<?> completeConnection(org.springframework.social.connect.web.ConnectSupport connectSupport, String providerId, javax.servlet.http.HttpServletRequest request) throws OAuth2Exception- Throws:
- OAuth2Exception
 
 - 
getConnectionFactoryprotected org.springframework.social.connect.ConnectionFactory<?> getConnectionFactory(String providerId) 
 - 
createProfileprotected Profile createProfile(String tenant, org.springframework.social.connect.Connection<?> connection, Profile userData) 
 
- 
 
-