Class ProviderLoginSupportImpl

    • Field Detail

      • connectSupport

        protected org.springframework.social.connect.web.ConnectSupport connectSupport
      • connectionFactoryLocator

        protected org.springframework.social.connect.ConnectionFactoryLocator connectionFactoryLocator
      • profileService

        protected org.craftercms.profile.api.services.ProfileService profileService
      • textEncryptor

        protected org.craftercms.commons.crypto.TextEncryptor textEncryptor
    • Constructor Detail

      • ProviderLoginSupportImpl

        public ProviderLoginSupportImpl()
    • Method Detail

      • setConnectSupport

        public void setConnectSupport​(org.springframework.social.connect.web.ConnectSupport connectSupport)
      • setConnectionFactoryLocator

        public void setConnectionFactoryLocator​(org.springframework.social.connect.ConnectionFactoryLocator connectionFactoryLocator)
      • setProfileService

        public void setProfileService​(org.craftercms.profile.api.services.ProfileService profileService)
      • setAuthenticationManager

        public void setAuthenticationManager​(AuthenticationManager authenticationManager)
      • setTextEncryptor

        public void setTextEncryptor​(org.craftercms.commons.crypto.TextEncryptor textEncryptor)
      • start

        public String start​(String tenant,
                            String providerId,
                            javax.servlet.http.HttpServletRequest request)
                     throws AuthenticationException
        Description copied from interface: ProviderLoginSupport
        Starts the OAuth login process. Returns a URL that the app should redirect to.
        Specified by:
        start in 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
      • start

        public String start​(String tenant,
                            String providerId,
                            javax.servlet.http.HttpServletRequest request,
                            org.springframework.util.MultiValueMap<String,​String> additionalUrlParams)
                     throws AuthenticationException
        Description copied from interface: ProviderLoginSupport
        Starts the OAuth login process. Returns a URL that the app should redirect to.
        Specified by:
        start in 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
      • start

        public 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: ProviderLoginSupport
        Starts the OAuth login process. Returns a URL that the app should redirect to.
        Specified by:
        start in 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
      • complete

        public Authentication complete​(String tenant,
                                       String providerId,
                                       javax.servlet.http.HttpServletRequest request,
                                       Set<String> newUserRoles,
                                       Map<String,​Object> newUserAttributes)
                                throws AuthenticationException
        Description copied from interface: ProviderLoginSupport
        Completes the OAuth authentication, returning the resulting Authentication object, or null if it couldn't be completed.
        Specified by:
        complete in 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
      • complete

        public 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: ProviderLoginSupport
        Completes the OAuth authentication, returning the resulting Authentication object, or null if it couldn't be completed.
        Specified by:
        complete in 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
      • completeConnection

        protected org.springframework.social.connect.Connection<?> completeConnection​(org.springframework.social.connect.web.ConnectSupport connectSupport,
                                                                                      String providerId,
                                                                                      javax.servlet.http.HttpServletRequest request)
                                                                               throws OAuth2Exception
        Throws:
        OAuth2Exception
      • getConnectionFactory

        protected org.springframework.social.connect.ConnectionFactory<?> getConnectionFactory​(String providerId)
      • getProfile

        protected org.craftercms.profile.api.Profile getProfile​(String tenant,
                                                                org.craftercms.profile.api.Profile userData)
      • createProfile

        protected org.craftercms.profile.api.Profile createProfile​(String tenant,
                                                                   org.springframework.social.connect.Connection<?> connection,
                                                                   org.craftercms.profile.api.Profile userData)
      • updateProfileConnectionData

        protected org.craftercms.profile.api.Profile updateProfileConnectionData​(String tenant,
                                                                                 org.springframework.social.connect.Connection<?> connection,
                                                                                 org.craftercms.profile.api.Profile profile)