Interface OAuthManager

    • Method Detail

      • getOAuthDataWithSharedToken

        Response getOAuthDataWithSharedToken​(Resource encryptedTokenResource,
                                             java.lang.String configId,
                                             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

        Response getOAuthDataWithUserToken​(SlingHttpServletRequest request,
                                           java.lang.String configId,
                                           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​(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: