Class UserAuthorizer (1.3.0)
Stay organized with collections
Save and categorize content based on your preferences.
publicclass UserAuthorizerHandles an interactive 3-Legged-OAuth2 (3LO) user consent authorization.
Inherited Members
Methods
getAndStoreCredentialsFromCode(String userId, String code, URI baseUri)
publicUserCredentialsgetAndStoreCredentialsFromCode(StringuserId,Stringcode,URIbaseUri)Exchanges an authorization code for tokens and stores them.
UserCredentials instance created from the authorization code.
An error from the server API call to get the tokens or store the tokens.
getAuthorizationUrl(String userId, String state, URI baseUri)
publicURLgetAuthorizationUrl(StringuserId,Stringstate,URIbaseUri)Return an URL that performs the authorization consent prompt web UI.
The URL that can be navigated or redirected to.
getCallbackUri()
publicURIgetCallbackUri()Returns the URI for implementation of the OAuth2 web callback.
The URI for the OAuth2 web callback.
getCallbackUri(URI baseUri)
publicURIgetCallbackUri(URIbaseUri)Returns the URI for implementation of the OAuth2 web callback, optionally relative to the specified URI.
The callback URI is often relative to enable an application to be tested from more than one place so this can be used to resolve it relative to another URI.
The resolved URI.
getClientId()
publicClientIdgetClientId()Returns the Client ID user to identify the OAuth2 consent prompt.
The Client ID.
getCredentials(String userId)
publicUserCredentialsgetCredentials(StringuserId)Attempts to retrieve credentials for the approved end user consent.
The loaded credentials or null if there are no valid approved credentials.
If there is error retrieving or loading the credentials.
getCredentialsFromCode(String code, URI baseUri)
publicUserCredentialsgetCredentialsFromCode(Stringcode,URIbaseUri)Returns a UserCredentials instance by exchanging an OAuth2 authorization code for tokens.
the UserCredentials instance created from the authorization code.
An error from the server API call to get the tokens.
getScopes()
publicCollection<String>getScopes()Returns the scopes defining the user consent.
getTokenStore()
publicTokenStoregetTokenStore()Returns the implementation of a component for long term storage of tokens.
The token storage implementation for long term storage of tokens.
monitorCredentials(String userId, UserCredentials credentials)
protectedvoidmonitorCredentials(StringuserId,UserCredentialscredentials)Adds a listen to rewrite the credentials when the tokens are refreshed.
newBuilder()
publicstaticUserAuthorizer.BuildernewBuilder()revokeAuthorization(String userId)
publicvoidrevokeAuthorization(StringuserId)Revokes the authorization for tokens stored for the user.
An error calling the revoke API or deleting the state.
storeCredentials(String userId, UserCredentials credentials)
publicvoidstoreCredentials(StringuserId,UserCredentialscredentials)Puts the end user credentials in long term storage.
An error storing the credentials.
toBuilder()
publicUserAuthorizer.BuildertoBuilder()