A store for instances of the subclasses of ArcGISCredential. The credential provided while handling an authentication challenge is placed in the ArcGIS credential store of the ArcGISEnvironment.authenticationManager and used by all subsequent requests that have a matching server context.



See also


Link copied to clipboard

Creates an instance of an ArcGISCredentialStore.


Link copied to clipboard
object Companion
Link copied to clipboard
sealed class Key : JsonSerializable

The key used to look up an ArcGISCredential in an ArcGISCredentialStore.

Link copied to clipboard

Represents a change in the ArcGISCredentialStore.


Link copied to clipboard

A SharedFlow which emits StoreChangedEvent when a credential is added, removed, updated or all credentials are removed from the store.


Link copied to clipboard
fun add(arcGISCredential: ArcGISCredential)

Adds the specified credential to the ArcGISCredentialStore. The credential's server context is used to determine what services the credential can be shared with. If a credential for the same server context is already in the store, then it will be replaced.

fun add(arcGISCredential: ArcGISCredential, url: String): Result<Unit>

Adds a specified credential to the store for a given URL. The URL must be shareable with the server context of the credential. Otherwise, this method throws an ErrorType.AuthenticationCredentialCannotBeShared. When the credential is added to the store with this function, for the credential to be shared with a secured service endpoint, the service endpoint must begin with the specified URL passed to this function call. For example, if you were to specify a store URL of when calling this function, then the specified credential would be shared with an endpoint such as, but not for If a credential was already stored for the same URL then it will be replaced.

Link copied to clipboard
open override fun close()
Link copied to clipboard

Returns the best matched credential in the ArcGISCredentialStore for the given URL.

Link copied to clipboard

Returns an array of unique credentials contained in the ArcGISCredentialStore. During a logout workflow, users should call this method before calling ArcGISCredentialStore.removeAll(), filter all instances of OAuthUserCredential and invalidate them by calling OAuthUserCredential.revokeToken().

Link copied to clipboard
fun remove(arcGISCredential: ArcGISCredential): Boolean

Removes the credential from ArcGISCredentialStore if present.

Link copied to clipboard
fun removeAll()

Removes all credentials from the ArcGISCredentialStore. During a logout workflow, before calling this function, users should call ArcGISCredentialStore.getCredentials(), filter all instances of OAuthUserCredential, and invalidate them using OAuthUserCredential.revokeToken().

Link copied to clipboard

Removes any credentials from the ArcGISCredentialStore that would be shared with a service endpoint represented by the provided URL.