CredentialCache QML Type

A cache containing credentials to reuse. More...

Import Statement: import Esri.ArcGISRuntime 100.15
Since: Esri.ArcGISRuntime 100.0
Inherits:

Object

Properties

Signals

Methods

Detailed Description

Note: You cannot declare or create a component of this type in QML code.

An instance of this type is available through the AuthenticationManager. It represents a cache containing credentials. All objects and tasks share this instance and could potentially reuse a credential if they need to access the same security realm.

The URL acts as the lookup key into the cache and represents one of the following:

  • The full path to a server from an ArcGIS Server.
  • The full path to a portal, portal item, or hosted item.
  • The URL to a portal, such as https://www.arcgis.com.
  • The URL to an ArcGIS Server instance, such as https://host(:port)/instance.

Automatic caching happens when a credential (that is, username, password, token, or OAuth client information) are required when connecting to a secure service hosted by ArcGIS Server, ArcGIS Online, or Federated by Portal. Upon successful connection to one of these secure services, the credential is cached in the CredentialCache and reused again whenever subsequent connections are made to the secure service.

Caching happens automatically if AuthenticationManager.isCredentialCacheEnabled is enabled. In addition, the CredentialCache type contains public methods to manipulate the cache contents.

Property Documentation

removeAndRevokeAllCredentialsErrors : list<CredentialErrorPair>

The list of pair of Credential and Error indicating why revocation of the associated Credential failed.

This property was introduced in Esri.ArcGISRuntime 100.8.

See also CredentialErrorPair.


removeAndRevokeAllCredentialsStatus : Enums.TaskStatus

The status for the task to remove and revoke all credentials from credential cache.

This property was introduced in Esri.ArcGISRuntime 100.8.

See also Enums.TaskStatus.


removeAndRevokeCredentialError : Error

The error related to the request to revoke the credential's OAuth token.

This property was introduced in Esri.ArcGISRuntime 100.8.


removeAndRevokeCredentialStatus : Enums.TaskStatus

The status for the task to remove and revoke the specified credential from credential cache.

This property was introduced in Esri.ArcGISRuntime 100.8.

See also Enums.TaskStatus.


Signal Documentation

removeAndRevokeAllCredentialsStatusChanged()

Emitted when the removeAndRevokeAllCredentialsStatus property changes.

Note: The corresponding handler is onRemoveAndRevokeAllCredentialsStatusChanged.

This signal was introduced in Esri.ArcGISRuntime 100.8.


removeAndRevokeCredentialStatusChanged()

Emitted when the removeAndRevokeCredentialStatus property changes.

Note: The corresponding handler is onRemoveAndRevokeCredentialStatusChanged.

This signal was introduced in Esri.ArcGISRuntime 100.8.


Method Documentation

Credential credential(url url)

Returns the credential for a given url.

See also setCredential().


void removeAllCredentials()

Removes all credentials from the cache.


void removeAndRevokeAllCredentials()

Removes all credentials from the cache and revokes tokens if appropriate.

If any credential is used for OAuth authentication, a request is sent to revoke its OAuth token. All credentials are removed from the cache even if OAuth token revocation fails.

The removeAndRevokeAllCredentialsErrors property is clear when the task is completed. When the task is completed, this property contains a map that will be empty if no errors occurred. If it is not empty, each entry contains a Credential for which OAuth token revocation failed and an Error indicating why it failed.

This method was introduced in Esri.ArcGISRuntime 100.8.


void removeAndRevokeCredential(Credential credential)

Removes the given credential from the cache and revokes its token if appropriate.

If the credential is used for OAuth authentication, a request is sent to revoke its OAuth token. The credential is removed from the cache even if OAuth token revocation fails.

The previous value of the property removeAndRevokeCredentialError is removed when the status of this task is completed. This property contains the error related to the request to revoke the OAuth token if an error occurred.

This method was introduced in Esri.ArcGISRuntime 100.8.


bool removeCredential(Credential credential)

Removes from the cache the credential and returns true if successful.


bool removeCredential(url url)

Removes from the cache the credential for a given url and returns true if successful.


bool setCredential(Credential credential, url url)

Sets the credential for a given url and returns true if successful.

This method will append a credential to the cache if the key for the URL does not already exist. The credential is replaced for the URL if the URL is already in the cache.

See also credential().


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.