OAuthUserCredential

A credential that access OAuth token-secured ArcGIS resources using an OAuthUserConfiguration. The OAuth user credential generates a short-lived access token that gives the user permission to access token-secured ArcGIS content and services, such as the ArcGIS location services.

To configure the lifetime of this credential, set the desired refresh token expiration and exchange intervals on the OAuthUserConfiguration.

  • Default behavior: The refresh token expires after two weeks and is exchanged every 24 hours, allowing users to remain logged in unless the app is unused for the entire two-week period.

  • Require re-authentication: Set the exchange interval to 0 to ensure users must log in again once the refresh token expires.

Creating this credential displays an OAuth login page to the user. To customize the appearance of the login page, adjust parameters such as OAuthUserConfiguration.showCancelButton or OAuthUserConfiguration.userInterfaceStyle.

If you use this OAuthUserCredential as part of the secure resource challenge handling, it will be stored in the ArcGISCredentialStore of the AuthenticationManager. It will be used by all subsequent requests that have a matching URL context.

Since

200.1.0

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

An authorization code to generate the OAuth token.

Link copied to clipboard

The OAuth configuration details of an application that can sign into an ArcGIS Online or ArcGIS Enterprise portal using OAuth.

Inherited properties

Link copied to clipboard

The referer used to generate a token.

Link copied to clipboard

The URL by which the root of a server is accessed. This is the URL against which rest endpoints are resolved. For example, "https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0" would have a server context of "https://sampleserver3.arcgisonline.com/ArcGIS", on which we could add "/rest/info" or "/rest" to fetch the server information.

Link copied to clipboard

The user associated with the credential.

Functions

Link copied to clipboard

Returns an instance of OAuthUserTokenInfo generated by this credential.

Link copied to clipboard
suspend fun revokeToken(): Result<Unit>

Sends a network request to revoke OAuth refresh and access tokens. This call will fail if the tokens have not been successfully revoked.

Inherited functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toJson(): String

Convert an object to JSON string.