Class OAuthProfileDefinition<P extends CommonProfile,​T extends com.github.scribejava.core.model.Token,​O extends OAuthConfiguration>

    • Constructor Detail

      • OAuthProfileDefinition

        public OAuthProfileDefinition()
      • OAuthProfileDefinition

        public OAuthProfileDefinition​(ProfileFactory<P> profileFactory)
    • Method Detail

      • getProfileVerb

        public com.github.scribejava.core.model.Verb getProfileVerb()
        Get HTTP Method to request profile.
        Returns:
        http verb
      • getProfileUrl

        public abstract String getProfileUrl​(T accessToken,
                                             O configuration)
        Retrieve the url of the profile of the authenticated user for the provider.
        Parameters:
        accessToken - only used when constructing dynamic urls from data in the token
        configuration - the current configuration
        Returns:
        the url of the user profile given by the provider
      • extractUserProfile

        public abstract P extractUserProfile​(String body)
        Extract the user profile from the response (JSON, XML...) of the profile url.
        Parameters:
        body - the response body
        Returns:
        the returned profile
      • raiseProfileExtractionJsonError

        protected void raiseProfileExtractionJsonError​(String body,
                                                       String missingNode)
        Throws a TechnicalException to indicate that user profile extraction has failed.
        Parameters:
        body - the request body that the user profile should be have been extracted from
        missingNode - the name of a JSON node that was found missing. may be omitted
      • raiseProfileExtractionJsonError

        protected void raiseProfileExtractionJsonError​(String body)
        Throws a TechnicalException to indicate that user profile extraction has failed.
        Parameters:
        body - the request body that the user profile should have been extracted from
      • raiseProfileExtractionError

        protected void raiseProfileExtractionError​(String body)
        Throws a TechnicalException to indicate that user profile extraction has failed.
        Parameters:
        body - the request body that the user profile should have been extracted from