Interface OAuthManager


  • @ProviderType
    public interface OAuthManager
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getAuthorizedId​(javax.servlet.http.HttpServletRequest request, java.lang.String configId)
      Retrieve the user id who has been authorized for the app configured; (The user id is stored in the encrypted cookie)
      java.lang.String getOAuthDataWithSharedToken​(Resource encryptedTokenResource, java.lang.String configId, java.lang.String url)
      Convenience method; same as:
      org.scribe.model.Response getOAuthDataWithSharedToken​(Resource encryptedTokenResource, java.lang.String configId, org.scribe.model.OAuthRequest oauthRequest)
      Use a shared token stored on encryptedTokenNode to retrieve protected data with the specified OAuthRequest
      java.lang.String getOAuthDataWithUserToken​(SlingHttpServletRequest request, java.lang.String configId, java.lang.String url)
      Convenience method; same as:
      org.scribe.model.Response getOAuthDataWithUserToken​(SlingHttpServletRequest request, java.lang.String configId, org.scribe.model.OAuthRequest oauthRequest)
      Use the user's access token (stored on the cookie or user profile jcr node) to retrieve protected data with the specified OAuthRequest
      Provider getProvider​(java.lang.String configId)
      Retrieve the Provider implementation specific within the config with this configId
    • Method Detail

      • getOAuthDataWithSharedToken

        org.scribe.model.Response getOAuthDataWithSharedToken​(Resource encryptedTokenResource,
                                                              java.lang.String configId,
                                                              org.scribe.model.OAuthRequest oauthRequest)
                                                       throws java.io.IOException
        Use a shared token stored on encryptedTokenNode to retrieve protected data with the specified OAuthRequest
        Parameters:
        encryptedTokenResource -
        configId -
        oauthRequest -
        Returns:
        Throws:
        java.io.IOException
      • getOAuthDataWithSharedToken

        java.lang.String getOAuthDataWithSharedToken​(Resource encryptedTokenResource,
                                                     java.lang.String configId,
                                                     java.lang.String url)
                                              throws java.io.IOException
        Convenience method; same as:
         
         OAuthRequest oauthRequest = new OAuthRequest(url, Verb.GET);
         getOAuthDataWithSharedToken(encryptedTokenResource, configId, oauthRequest);
         
         
        Parameters:
        encryptedTokenResource -
        configId -
        url -
        Returns:
        Throws:
        java.io.IOException
      • getOAuthDataWithUserToken

        org.scribe.model.Response getOAuthDataWithUserToken​(SlingHttpServletRequest request,
                                                            java.lang.String configId,
                                                            org.scribe.model.OAuthRequest oauthRequest)
                                                     throws java.io.IOException
        Use the user's access token (stored on the cookie or user profile jcr node) to retrieve protected data with the specified OAuthRequest
        Parameters:
        request -
        configId -
        oauthRequest -
        Returns:
        String text of response
        Throws:
        java.io.IOException
      • getOAuthDataWithUserToken

        java.lang.String getOAuthDataWithUserToken​(SlingHttpServletRequest request,
                                                   java.lang.String configId,
                                                   java.lang.String url)
                                            throws java.io.IOException
        Convenience method; same as:
         
         OAuthRequest oauthRequest = new OAuthRequest(url, Verb.GET);
         getOAuthDataStreamWithUserToken(request, configId, oauthRequest);
         
         
        Parameters:
        request -
        configId -
        url -
        Returns:
        Throws:
        java.io.IOException
      • getProvider

        Provider getProvider​(java.lang.String configId)
        Retrieve the Provider implementation specific within the config with this configId
        Parameters:
        configId -
        Returns:
        the Provider or null if the config providerId doesn't match any registered providers
      • getAuthorizedId

        java.lang.String getAuthorizedId​(javax.servlet.http.HttpServletRequest request,
                                         java.lang.String configId)
        Retrieve the user id who has been authorized for the app configured; (The user id is stored in the encrypted cookie)
        Parameters:
        request -
        configId - the id of the configuration
        Returns: