Class UserAuthorizer.Builder
java.lang.Object
com.google.auth.oauth2.UserAuthorizer.Builder
- Enclosing class:
UserAuthorizer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate URIprivate ClientIdprivate PKCEProviderprivate Collection<String> private URIprivate TokenStoreprivate HttpTransportFactoryprivate URI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()setCallbackUri(URI callbackUri) Sets the redirect URI registered with your OAuth provider.setClientAuthenticationType(UserAuthorizer.ClientAuthenticationType clientAuthentication) Sets the optionalUserAuthorizer.ClientAuthenticationType, one of the client authentication methods defined in RFC 7591.setClientId(ClientId clientId) Sets the OAuth 2.0 client ID.setHttpTransportFactory(HttpTransportFactory transportFactory) Sets the HTTP transport factory.setPKCEProvider(PKCEProvider pkce) Sets the optionalPKCEProviderto enable Proof Key for Code Exchange to be used.setScopes(Collection<String> scopes) Sets the OAuth 2.0 scopes to request.setTokenServerUri(URI tokenServerUri) Sets the token exchange endpoint.setTokenStore(TokenStore tokenStore) Sets theTokenStoreto use for long term token storage.setUserAuthUri(URI userAuthUri) Sets the authorization URI where the user is directed to log in and grant authorization.
-
Field Details
-
clientId
-
tokenStore
-
callbackUri
-
tokenServerUri
-
userAuthUri
-
scopes
-
transportFactory
-
pkce
-
clientAuthenticationType
-
-
Constructor Details
-
Builder
protected Builder() -
Builder
-
-
Method Details
-
setClientId
Sets the OAuth 2.0 client ID.- Parameters:
clientId- the client ID- Returns:
- this
Builderobject
-
setTokenStore
Sets theTokenStoreto use for long term token storage.- Parameters:
tokenStore- the token store- Returns:
- this
Builderobject
-
setScopes
Sets the OAuth 2.0 scopes to request.- Parameters:
scopes- the scopes to request- Returns:
- this
Builderobject
-
setTokenServerUri
Sets the token exchange endpoint.- Parameters:
tokenServerUri- the token exchange endpoint to use- Returns:
- this
Builderobject
-
setCallbackUri
Sets the redirect URI registered with your OAuth provider. This is where the user's browser will be redirected after granting or denying authorization.- Parameters:
callbackUri- the redirect URI- Returns:
- this
Builderobject
-
setUserAuthUri
Sets the authorization URI where the user is directed to log in and grant authorization.- Parameters:
userAuthUri- the authorization URI- Returns:
- this
Builderobject
-
setHttpTransportFactory
@CanIgnoreReturnValue public UserAuthorizer.Builder setHttpTransportFactory(HttpTransportFactory transportFactory) Sets the HTTP transport factory.- Parameters:
transportFactory- theHttpTransportFactoryto set- Returns:
- this
Builderobject
-
setPKCEProvider
Sets the optionalPKCEProviderto enable Proof Key for Code Exchange to be used. This enhances security by using a code challenge and verifier to prevent authorization code interception attacks.- Parameters:
pkce- thePKCEProviderto set- Returns:
- this
Builderobject
-
setClientAuthenticationType
@CanIgnoreReturnValue public UserAuthorizer.Builder setClientAuthenticationType(UserAuthorizer.ClientAuthenticationType clientAuthentication) Sets the optionalUserAuthorizer.ClientAuthenticationType, one of the client authentication methods defined in RFC 7591. This specifies how your application authenticates itself to the authorization server.- Parameters:
clientAuthentication- theClientAuthenticationTypeto set- Returns:
- this
Builderobject
-
getClientId
-
getTokenStore
-
getScopes
-
getTokenServerUri
-
getCallbackUri
-
getUserAuthUri
-
getHttpTransportFactory
-
getPKCEProvider
-
getClientAuthenticationType
-
build
-