| Modifier and Type | Class and Description |
|---|---|
static interface |
AuthorizationService.RegistrationResponseCallback
Callback interface for token endpoint requests.
|
static interface |
AuthorizationService.TokenResponseCallback
Callback interface for token endpoint requests.
|
| Constructor and Description |
|---|
AuthorizationService(android.content.Context context)
Creates an AuthorizationService instance, using the
default configuration. |
AuthorizationService(android.content.Context context,
AppAuthConfiguration clientConfiguration)
Creates an AuthorizationService instance, using the specified configuration.
|
| Modifier and Type | Method and Description |
|---|---|
android.support.customtabs.CustomTabsIntent.Builder |
createCustomTabsIntentBuilder(android.net.Uri... possibleUris)
Creates a custom tab builder, that will use a tab session from an existing connection to
a web browser, if available.
|
void |
dispose()
Disposes state that will not normally be handled by garbage collection.
|
android.content.Intent |
getAuthorizationRequestIntent(AuthorizationRequest request)
Constructs an intent that encapsulates the provided request and a default custom tabs intent,
and is intended to be launched via
Activity#startActivityForResult
When started, the intent launches an Activity that sends an authorization request
to the authorization service, using a
custom tab. |
android.content.Intent |
getAuthorizationRequestIntent(AuthorizationRequest request,
android.support.customtabs.CustomTabsIntent customTabsIntent)
Constructs an intent that encapsulates the provided request and custom tabs intent,
and is intended to be launched via
Activity#startActivityForResult. |
CustomTabManager |
getCustomTabManager() |
void |
performAuthorizationRequest(AuthorizationRequest request,
android.app.PendingIntent completedIntent)
Sends an authorization request to the authorization service, using a
custom tab
if available, or a browser instance.
|
void |
performAuthorizationRequest(AuthorizationRequest request,
android.app.PendingIntent completedIntent,
android.support.customtabs.CustomTabsIntent customTabsIntent)
Sends an authorization request to the authorization service, using a
custom tab.
|
void |
performAuthorizationRequest(AuthorizationRequest request,
android.app.PendingIntent completedIntent,
android.app.PendingIntent canceledIntent)
Sends an authorization request to the authorization service, using a
custom tab
if available, or a browser instance.
|
void |
performAuthorizationRequest(AuthorizationRequest request,
android.app.PendingIntent completedIntent,
android.app.PendingIntent canceledIntent,
android.support.customtabs.CustomTabsIntent customTabsIntent)
Sends an authorization request to the authorization service, using a
custom tab.
|
void |
performRegistrationRequest(RegistrationRequest request,
AuthorizationService.RegistrationResponseCallback callback)
Sends a request to the authorization service to dynamically register a client.
|
void |
performTokenRequest(TokenRequest request,
AuthorizationService.TokenResponseCallback callback)
Sends a request to the authorization service to exchange a code granted as part of an
authorization request for a token.
|
void |
performTokenRequest(TokenRequest request,
ClientAuthentication clientAuthentication,
AuthorizationService.TokenResponseCallback callback)
Sends a request to the authorization service to exchange a code granted as part of an
authorization request for a token.
|
public AuthorizationService(@NonNull
android.content.Context context)
Creates an AuthorizationService instance, using the
default configuration. Note that
instances of this class must be manually disposed when no longer required, to avoid
leaks (see dispose().
public AuthorizationService(@NonNull
android.content.Context context,
@NonNull
AppAuthConfiguration clientConfiguration)
Creates an AuthorizationService instance, using the specified configuration. Note that
instances of this class must be manually disposed when no longer required, to avoid
leaks (see dispose().
public CustomTabManager getCustomTabManager()
public android.support.customtabs.CustomTabsIntent.Builder createCustomTabsIntentBuilder(android.net.Uri... possibleUris)
Creates a custom tab builder, that will use a tab session from an existing connection to a web browser, if available.
public void performAuthorizationRequest(@NonNull
AuthorizationRequest request,
@NonNull
android.app.PendingIntent completedIntent)
Sends an authorization request to the authorization service, using a
custom tab
if available, or a browser instance.
The parameters of this request are determined by both the authorization service
configuration and the provided request object. Upon completion
of this request, the provided completion PendingIntent will be invoked.
If the user cancels the authorization request, the current activity will regain control.
public void performAuthorizationRequest(@NonNull
AuthorizationRequest request,
@NonNull
android.app.PendingIntent completedIntent,
@NonNull
android.app.PendingIntent canceledIntent)
Sends an authorization request to the authorization service, using a
custom tab
if available, or a browser instance.
The parameters of this request are determined by both the authorization service
configuration and the provided request object. Upon completion
of this request, the provided completion PendingIntent will be invoked.
If the user cancels the authorization request, the provided
cancel PendingIntent will be invoked.
public void performAuthorizationRequest(@NonNull
AuthorizationRequest request,
@NonNull
android.app.PendingIntent completedIntent,
@NonNull
android.support.customtabs.CustomTabsIntent customTabsIntent)
Sends an authorization request to the authorization service, using a
custom tab.
The parameters of this request are determined by both the authorization service
configuration and the provided request object. Upon completion
of this request, the provided completion PendingIntent will be invoked.
If the user cancels the authorization request, the current activity will regain control.
customTabsIntent - The intent that will be used to start the custom tab. It is recommended that this intent
be created with the help of createCustomTabsIntentBuilder(Uri[]), which will
ensure that a warmed-up version of the browser will be used, minimizing latency.public void performAuthorizationRequest(@NonNull
AuthorizationRequest request,
@NonNull
android.app.PendingIntent completedIntent,
@Nullable
android.app.PendingIntent canceledIntent,
@NonNull
android.support.customtabs.CustomTabsIntent customTabsIntent)
Sends an authorization request to the authorization service, using a
custom tab.
The parameters of this request are determined by both the authorization service
configuration and the provided request object. Upon completion
of this request, the provided completion PendingIntent will be invoked.
If the user cancels the authorization request, the provided
cancel PendingIntent will be invoked.
customTabsIntent - The intent that will be used to start the custom tab. It is recommended that this intent
be created with the help of createCustomTabsIntentBuilder(Uri[]), which will
ensure that a warmed-up version of the browser will be used, minimizing latency.android.content.ActivityNotFoundException - if no suitable browser is available to
perform the authorization flow.public android.content.Intent getAuthorizationRequestIntent(@NonNull
AuthorizationRequest request,
@NonNull
android.support.customtabs.CustomTabsIntent customTabsIntent)
Constructs an intent that encapsulates the provided request and custom tabs intent,
and is intended to be launched via Activity#startActivityForResult.
The parameters of this request are determined by both the authorization service
configuration and the provided request object. Upon completion
of this request, the activity that gets launched will call Activity#setResult with
Activity#RESULT_OK and an Intent containing authorization completion
information. If the user presses the back button or closes the browser tab, the launched
activity will call Activity#setResult with
Activity#RESULT_CANCELED without a data Intent. Note that
Activity#RESULT_OK indicates the authorization request completed,
not necessarily that it was a successful authorization.
customTabsIntent - The intent that will be used to start the custom tab. It is recommended that this intent
be created with the help of createCustomTabsIntentBuilder(Uri[]), which will
ensure that a warmed-up version of the browser will be used, minimizing latency.android.content.ActivityNotFoundException - if no suitable browser is available to
perform the authorization flow.public android.content.Intent getAuthorizationRequestIntent(@NonNull
AuthorizationRequest request)
Constructs an intent that encapsulates the provided request and a default custom tabs intent,
and is intended to be launched via Activity#startActivityForResult
When started, the intent launches an Activity that sends an authorization request
to the authorization service, using a
custom tab.
The parameters of this request are determined by both the authorization service
configuration and the provided request object. Upon completion
of this request, the activity that gets launched will call Activity#setResult with
Activity#RESULT_OK and an Intent containing authorization completion
information. If the user presses the back button or closes the browser tab, the launched
activity will call Activity#setResult with
Activity#RESULT_CANCELED without a data Intent. Note that
Activity#RESULT_OK indicates the authorization request completed,
not necessarily that it was a successful authorization.
android.content.ActivityNotFoundException - if no suitable browser is available to
perform the authorization flow.public void performTokenRequest(@NonNull
TokenRequest request,
@NonNull
AuthorizationService.TokenResponseCallback callback)
Sends a request to the authorization service to exchange a code granted as part of an authorization request for a token. The result of this request will be sent to the provided callback handler.
public void performTokenRequest(@NonNull
TokenRequest request,
@NonNull
ClientAuthentication clientAuthentication,
@NonNull
AuthorizationService.TokenResponseCallback callback)
Sends a request to the authorization service to exchange a code granted as part of an authorization request for a token. The result of this request will be sent to the provided callback handler.
public void performRegistrationRequest(@NonNull
RegistrationRequest request,
@NonNull
AuthorizationService.RegistrationResponseCallback callback)
Sends a request to the authorization service to dynamically register a client. The result of this request will be sent to the provided callback handler.
public void dispose()
Disposes state that will not normally be handled by garbage collection. This should be
called when the authorization service is no longer required, including when any owning
activity is paused or destroyed (i.e. in Activity.onStop()).