Class TokenCachePersistenceOptions

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

public final class TokenCachePersistenceOptions extends Object
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.
See Also:
  • Constructor Details

    • TokenCachePersistenceOptions

      public TokenCachePersistenceOptions()
      Constructs an instance of TokenCachePersistenceOptions.
  • Method Details

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

      public String getName()
      Get the name uniquely identifying the cache.
      Returns:
      the name of the cache.