TokenCachePersistenceOptions Class

  • java.lang.Object
    • com.azure.identity.TokenCachePersistenceOptions

public final class TokenCachePersistenceOptions

Represents the Persistence Token Cache options used to setup the persistent access token cache. It allows users to enable the persistent token cache and optionally configure its name. The TokenCachePersistenceOptions can be configured directly on the Token Credential builders for the Token Credentials that support it.

Constructor Summary

Constructor Description
TokenCachePersistenceOptions()

Constructs an instance of TokenCachePersistenceOptions.

Method Summary

Modifier and Type Method and Description
String getName()

Get the name uniquely identifying the cache.

boolean isUnencryptedStorageAllowed()

Gets the status whether unencrypted storage is allowed for the persistent token cache.

TokenCachePersistenceOptions setName(String name)

Set the name uniquely identifying the cache.

TokenCachePersistenceOptions setUnencryptedStorageAllowed(boolean unencryptedStorageAllowed)

Allows to use an unprotected file specified by cacheFileLocation() instead of Gnome keyring on Linux.

Methods inherited from java.lang.Object

Constructor Details

TokenCachePersistenceOptions

public TokenCachePersistenceOptions()

Constructs an instance of TokenCachePersistenceOptions.

Method Details

getName

public String getName()

Get the name uniquely identifying the cache.

Returns:

the name of the cache.

isUnencryptedStorageAllowed

public boolean isUnencryptedStorageAllowed()

Gets the status whether unencrypted storage is allowed for the persistent token cache.

Returns:

The status indicating if unencrypted storage is allowed for the persistent token cache.

setName

public TokenCachePersistenceOptions setName(String name)

Set the name uniquely identifying the cache.

Parameters:

name - the name of the cache

Returns:

the updated instance of the cache.

setUnencryptedStorageAllowed

public TokenCachePersistenceOptions setUnencryptedStorageAllowed(boolean unencryptedStorageAllowed)

Allows to use an unprotected file specified by cacheFileLocation() instead of Gnome keyring on Linux. This is restricted by default. For other platforms this setting currently doesn't apply.

Parameters:

unencryptedStorageAllowed - The flag indicating if unencrypted storage is allowed for the cache or not.

Returns:

An updated instance of the options bag.

Applies to