Class UserAuthorizer.Builder (1.27.0)

publicstaticclass UserAuthorizer.Builder

Inheritance

java.lang.Object > UserAuthorizer.Builder

Constructors

Builder()

protectedBuilder()

Builder(UserAuthorizer authorizer)

protectedBuilder(UserAuthorizerauthorizer)
Parameter
Name Description
authorizer UserAuthorizer

Methods

build()

publicUserAuthorizerbuild()
Returns
Type Description
UserAuthorizer

getCallbackUri()

publicURIgetCallbackUri()
Returns
Type Description
URI

getClientAuthenticationType()

publicUserAuthorizer.ClientAuthenticationTypegetClientAuthenticationType()
Returns
Type Description
UserAuthorizer.ClientAuthenticationType

getClientId()

publicClientIdgetClientId()
Returns
Type Description
ClientId

getHttpTransportFactory()

publicHttpTransportFactorygetHttpTransportFactory()
Returns
Type Description
HttpTransportFactory

getPKCEProvider()

publicPKCEProvidergetPKCEProvider()
Returns
Type Description
PKCEProvider

getScopes()

publicCollection<String>getScopes()
Returns
Type Description
Collection<String>

getTokenServerUri()

publicURIgetTokenServerUri()
Returns
Type Description
URI

getTokenStore()

publicTokenStoregetTokenStore()
Returns
Type Description
TokenStore

getUserAuthUri()

publicURIgetUserAuthUri()
Returns
Type Description
URI

setCallbackUri(URI callbackUri)

publicUserAuthorizer.BuildersetCallbackUri(URIcallbackUri)

Sets the redirect URI registered with your OAuth provider. This is where the user's browser will be redirected after granting or denying authorization.

Parameter
Name Description
callbackUri URI

the redirect URI

Returns
Type Description
UserAuthorizer.Builder

this Builder object

setClientAuthenticationType(UserAuthorizer.ClientAuthenticationType clientAuthentication)

publicUserAuthorizer.BuildersetClientAuthenticationType(UserAuthorizer.ClientAuthenticationTypeclientAuthentication)

Sets the optional ClientAuthenticationType, one of the client authentication methods defined in RFC 7591. This specifies how your application authenticates itself to the authorization server.

Parameter
Name Description
clientAuthentication UserAuthorizer.ClientAuthenticationType

the ClientAuthenticationType to set

Returns
Type Description
UserAuthorizer.Builder

this Builder object

setClientId(ClientId clientId)

publicUserAuthorizer.BuildersetClientId(ClientIdclientId)

Sets the OAuth 2.0 client ID.

Parameter
Name Description
clientId ClientId

the client ID

Returns
Type Description
UserAuthorizer.Builder

this Builder object

setHttpTransportFactory(HttpTransportFactory transportFactory)

publicUserAuthorizer.BuildersetHttpTransportFactory(HttpTransportFactorytransportFactory)

Sets the HTTP transport factory.

Parameter
Name Description
transportFactory HttpTransportFactory

the HttpTransportFactory to set

Returns
Type Description
UserAuthorizer.Builder

this Builder object

setPKCEProvider(PKCEProvider pkce)

publicUserAuthorizer.BuildersetPKCEProvider(PKCEProviderpkce)

Sets the optional PKCEProvider to 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.

Parameter
Name Description
pkce PKCEProvider

the PKCEProvider to set

Returns
Type Description
UserAuthorizer.Builder

this Builder object

setScopes(Collection<String> scopes)

publicUserAuthorizer.BuildersetScopes(Collection<String>scopes)

Sets the OAuth 2.0 scopes to request.

Parameter
Name Description
scopes Collection<String>

the scopes to request

Returns
Type Description
UserAuthorizer.Builder

this Builder object

setTokenServerUri(URI tokenServerUri)

publicUserAuthorizer.BuildersetTokenServerUri(URItokenServerUri)

Sets the token exchange endpoint.

Parameter
Name Description
tokenServerUri URI

the token exchange endpoint to use

Returns
Type Description
UserAuthorizer.Builder

this Builder object

setTokenStore(TokenStore tokenStore)

publicUserAuthorizer.BuildersetTokenStore(TokenStoretokenStore)

Sets the TokenStore to use for long term token storage.

Parameter
Name Description
tokenStore TokenStore

the token store

Returns
Type Description
UserAuthorizer.Builder

this Builder object

setUserAuthUri(URI userAuthUri)

publicUserAuthorizer.BuildersetUserAuthUri(URIuserAuthUri)

Sets the authorization URI where the user is directed to log in and grant authorization.

Parameter
Name Description
userAuthUri URI

the authorization URI

Returns
Type Description
UserAuthorizer.Builder

this Builder object

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.