Skip To Content ArcGIS for Developers Sign In Dashboard

CredentialCache QML Type

A cache containing credentials to reuse. More...

Import Statement: import Esri.ArcGISRuntime 100.7
Since: Esri.ArcGISRuntime 100.0



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
  • 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.

Method Documentation

Credential credential(url url)

Returns the credential for a given url.

void removeAllCredentials()

Removes all credentials from the cache.

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.

Feedback on this topic?