A client for the authorization API.
Public Method Summary
abstract Task<AuthorizationResult> |
authorize(AuthorizationRequest
request)
Requests authorization to access the Google data associated with a signed-in
account on the device.
|
abstract AuthorizationResult |
getAuthorizationResultFromIntent(Intent data)
Retrieves the
AuthorizationResult from the Intent
returned upon successful authorization, throwing an ApiException
if no result is present or authorization has failed.
|
Public Methods
public abstract Task<AuthorizationResult> authorize (AuthorizationRequest request)
Requests authorization to access the Google data associated with a signed-in account on the device.
If an eligible signed-in account is found for the application, this request will
verify that all the requested OAuth 2.0 scopes were previously granted by the user. If
they were, the requested tokens will be returned in the result. If, however, no saved
account is found or the required grants do not exist, the result will contain a
PendingIntent
that can be used to launch the authorization flow. During that flow, the user will be
asked to select an account and/or grant the permission for all or a subset of requested
scopes. An exception will be set on the returned Task
if
authorization is not available on the device (for example, internal error or Play
Services not available).
Parameters
request | configuration for the authorization operation. |
---|
Returns
Task
which contains the result of the operation.
public abstract AuthorizationResult getAuthorizationResultFromIntent (Intent data)
Retrieves the AuthorizationResult
from the Intent
returned upon successful authorization, throwing an ApiException
if no result is present or authorization has failed.
Throws
ApiException |
---|