Package version:

Interface ClientAssertionCredentialOptions

Options for the ClientAssertionCredential

interface ClientAssertionCredentialOptions {
    additionallyAllowedTenants?: {};
    authorityHost?: string;
    disableInstanceDiscovery?: boolean;
    loggingOptions?: any;
    tokenCachePersistenceOptions?: TokenCachePersistenceOptions;
}

Hierarchy (view full)

Properties

additionallyAllowedTenants?: {}

For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the application is installed.

authorityHost?: string

The authority host to use for authentication requests. Possible values are available through AzureAuthorityHosts. The default is "https://login.microsoftonline.com".

disableInstanceDiscovery?: boolean

The field determines whether instance discovery is performed when attempting to authenticate. Setting this to true will completely disable both instance discovery and authority validation. As a result, it's crucial to ensure that the configured authority host is valid and trustworthy. 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.

loggingOptions?: any

Allows users to configure settings for logging policy options, allow logging account information and personally identifiable information for customer support.

tokenCachePersistenceOptions?: TokenCachePersistenceOptions

Options to provide to the persistence layer (if one is available) when storing credentials.

You must first register a persistence provider plugin. See the @azure/identity-cache-persistence package on NPM.

Example:

import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";

useIdentityPlugin(cachePersistencePlugin);

const credential = new DeviceCodeCredential({
tokenCachePersistenceOptions: {
enabled: true,
},
});