Table of Contents

Class SharedTokenCacheCredentialOptions

Namespace
Azure.Identity
Assembly
Azure.Identity.dll

Options to configure the SharedTokenCacheCredential authentication.

public class SharedTokenCacheCredentialOptions : TokenCredentialOptions
Inheritance
SharedTokenCacheCredentialOptions
Inherited Members

Constructors

SharedTokenCacheCredentialOptions()

Initializes a new instance of SharedTokenCacheCredentialOptions.

public SharedTokenCacheCredentialOptions()

SharedTokenCacheCredentialOptions(TokenCachePersistenceOptions)

Initializes a new instance of SharedTokenCacheCredentialOptions.

public SharedTokenCacheCredentialOptions(TokenCachePersistenceOptions tokenCacheOptions)

Parameters

tokenCacheOptions TokenCachePersistenceOptions

The TokenCachePersistenceOptions that will apply to the token cache used by this credential.

Properties

AuthenticationRecord

The AuthenticationRecord captured from a previous authentication with an interactive credential, such as the InteractiveBrowserCredential or DeviceCodeCredential.

public AuthenticationRecord AuthenticationRecord { get; set; }

Property Value

AuthenticationRecord

ClientId

The client id of the application registration used to authenticate users in the cache.

public string ClientId { get; set; }

Property Value

string

DisableInstanceDiscovery

Gets or sets the setting which determines whether or not instance discovery is performed when attempting to authenticate. Setting this to true will completely disable both instance discovery and authority validation. This functionality is intended for use in scenarios where the metadata endpoint cannot be reached, such as in private clouds or Azure Stack. The process of instance discovery entails retrieving authority metadata from https://login.microsoft.com/ to validate the authority. By setting this to true, the validation of the authority is disabled. As a result, it is crucial to ensure that the configured authority host is valid and trustworthy."

public bool DisableInstanceDiscovery { get; set; }

Property Value

bool

EnableGuestTenantAuthentication

When set to true the SharedTokenCacheCredential can be used to authenticate to tenants other than the home tenant, requiring Username and TenantId also to be specified as well.

public bool EnableGuestTenantAuthentication { get; set; }

Property Value

bool

TenantId

Specifies the tenant id of the preferred authentication account, to be retrieved from the shared token cache for single sign on authentication with development tools, in the case multiple accounts are found in the shared token.

public string TenantId { get; set; }

Property Value

string

TokenCachePersistenceOptions

Specifies the TokenCachePersistenceOptions to be used by the credential. Value cannot be null.

public TokenCachePersistenceOptions TokenCachePersistenceOptions { get; set; }

Property Value

TokenCachePersistenceOptions

Username

Specifies the preferred authentication account username, or UPN, to be retrieved from the shared token cache for single sign on authentication with development tools, in the case multiple accounts are found in the shared token.

public string Username { get; set; }

Property Value

string