Class OAuthProfileDefinition

    • Field Summary

      • Fields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition

        DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URL
      • Fields inherited from class org.pac4j.core.profile.definition.ProfileDefinition

        logger
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract org.pac4j.core.profile.CommonProfile extractUserProfile​(java.lang.String body)
      Extract the user profile from the response (JSON, XML...) of the profile url.
      abstract java.lang.String getProfileUrl​(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration)
      Retrieve the url of the profile of the authenticated user for the provider.
      com.github.scribejava.core.model.Verb getProfileVerb()
      Get HTTP Method to request profile.
      protected void raiseProfileExtractionError​(java.lang.String body)
      Throws a TechnicalException to indicate that user profile extraction has failed.
      protected void raiseProfileExtractionJsonError​(java.lang.String body)
      Throws a TechnicalException to indicate that user profile extraction has failed.
      protected void raiseProfileExtractionJsonError​(java.lang.String body, java.lang.String missingNode)
      Throws a TechnicalException to indicate that user profile extraction has failed.
      • Methods inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition

        configurePrimaryAttributes
      • Methods inherited from class org.pac4j.core.profile.definition.ProfileDefinition

        convertAndAdd, convertAndAdd, getConverters, getParameter, getPrimaryAttributes, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OAuthProfileDefinition

        public OAuthProfileDefinition()
      • OAuthProfileDefinition

        public OAuthProfileDefinition​(org.pac4j.core.profile.factory.ProfileFactory profileFactory)
    • Method Detail

      • getProfileVerb

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

        public abstract java.lang.String getProfileUrl​(com.github.scribejava.core.model.Token accessToken,
                                                       OAuthConfiguration 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 org.pac4j.core.profile.CommonProfile extractUserProfile​(java.lang.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​(java.lang.String body,
                                                       java.lang.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​(java.lang.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​(java.lang.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