Class OAuth20ProfileCreator<U extends OAuth20Profile>

    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
      • mapper

        protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Method Detail

      • getAccessToken

        protected com.github.scribejava.core.model.OAuth2AccessToken getAccessToken​(OAuth20Credentials credentials)
        Get the access token from OAuth credentials.
        Parameters:
        credentials - credentials
        Returns:
        the access token
      • addAccessTokenToProfile

        protected void addAccessTokenToProfile​(U profile,
                                               com.github.scribejava.core.model.OAuth2AccessToken accessToken)
        Add the access token to the profile (as an attribute).
        Parameters:
        profile - the user profile
        accessToken - the access token
      • signRequest

        protected void signRequest​(com.github.scribejava.core.oauth.OAuth20Service service,
                                   com.github.scribejava.core.model.OAuth2AccessToken accessToken,
                                   com.github.scribejava.core.model.OAuthRequest request)
        Sign the request.
        Parameters:
        service - the service
        accessToken - the token
        request - the request
      • retrieveUserProfileFromToken

        protected Optional<UserProfile> retrieveUserProfileFromToken​(WebContext context,
                                                                     T accessToken)
        Retrieve the user profile from the access token.
        Parameters:
        context - the web context
        accessToken - the access token
        Returns:
        the user profile
      • sendRequestForData

        protected String sendRequestForData​(S service,
                                            T accessToken,
                                            String dataUrl,
                                            com.github.scribejava.core.model.Verb verb)
        Make a request to get the data of the authenticated user for the provider.
        Parameters:
        service - the OAuth service
        accessToken - the access token
        dataUrl - url of the data
        verb - method used to request data
        Returns:
        the user data response
      • createOAuthRequest

        protected com.github.scribejava.core.model.OAuthRequest createOAuthRequest​(String url,
                                                                                   com.github.scribejava.core.model.Verb verb)
        Create an OAuth request.
        Parameters:
        url - the url to call
        verb - method used to create the request
        Returns:
        the request