Builder forAuthorizationRequest
.
Public Constructor Summary
Builder()
|
Public Method Summary
AuthorizationRequest.Builder |
addResourceParameter(AuthorizationRequest.ResourceParameter
resourceParameter,String
resourceParameterValue)
Adds a resource parameter.
|
AuthorizationRequest |
build()
Builds the
AuthorizationRequest .
|
AuthorizationRequest.Builder | |
AuthorizationRequest.Builder | |
AuthorizationRequest.Builder |
requestOfflineAccess(String
serverClientId, boolean forceCodeForRefreshToken)
Specifies that offline access is requested.
|
AuthorizationRequest.Builder | |
AuthorizationRequest.Builder |
setRequestedScopes(List<Scope>
requestedScopes)
Sets the list of OAuth 2.0 scopes that the application is requesting.
|
Inherited Method Summary
Public Constructors
publicBuilder()
Public Methods
public AuthorizationRequest.BuilderaddResourceParameter(AuthorizationRequest.ResourceParameter resourceParameter,String resourceParameterValue)
Adds a resource parameter.
publicAuthorizationRequest build()
Builds the
AuthorizationRequest
.
public AuthorizationRequest.BuilderfilterByHostedDomain(String hostedDomain)
Specifies a hosted domain restriction.
By setting this, authorization will be restricted to accounts of the user in the specified domain.
Parameters
hostedDomain | domain of the user to restrict (for example, "mycollege.edu" ), |
---|
public AuthorizationRequest.BuilderrequestOfflineAccess(String serverClientId)
Specifies that offline access is requested. When offline access is requested, an authorization code is returned so the server can use the authorization code to exchange for a refresh token. The refresh token allows the server to access Google data when the user is not actively using the app.
Parameters
serverClientId | The client ID of the server that will need the authorization code. |
---|
public AuthorizationRequest.BuilderrequestOfflineAccess(StringserverClientId, boolean forceCodeForRefreshToken)
Specifies that offline access is requested. When offline access is requested, an authorization code is returned so the server can use the authorization code to exchange for a refresh token. The refresh token allows the server to access Google data when the user is not actively using the app.
Parameters
serverClientId | The client ID of the server that will need the authorization code. |
---|---|
forceCodeForRefreshToken | If true, the granted code can be exchanged for an access token and a refresh token. The first time you retrieve a code, a refresh token will be granted automatically. Subsequent requests will require additional user consent. Use false by default; only use true if your server has suffered some failure and lost the user's refresh token. |
public AuthorizationRequest.BuildersetAccount(Account account)
Specifies an account on the device that should be used.
Parameters
account | The account on the device that should be used for authorization. |
---|
public AuthorizationRequest.BuildersetRequestedScopes(List<Scope> requestedScopes)
Sets the list of OAuth 2.0 scopes that the application is requesting.