A client for the authorization API.
Public Method Summary
abstractTask<AuthorizationResult> |
authorize(AuthorizationRequest
request)
Requests authorization to access the Google data associated with a signed-in
account on the device.
|
abstract AuthorizationResult |
getAuthorizationResultFromIntent(Intentdata)
Retrieves the
AuthorizationResult from theIntent
returned upon successful authorization, throwing anApiException
if no result is present or authorization has failed.
|
Public Methods
public abstractTask<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 returnedTask
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 abstractAuthorizationResult getAuthorizationResultFromIntent(Intent data)
Retrieves theAuthorizationResult
from theIntent
returned upon successful authorization, throwing anApiException
if no result is present or authorization has failed.
Throws
ApiException |
---|