你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CredentialPersistenceOptions interface

支持持久令牌缓存的凭据的共享配置选项。

属性

tokenCachePersistenceOptions

存储凭据时提供给持久性层的选项(如果有)。

必须首先注册持久性提供程序插件。 请参阅 NPM 上的 @azure/identity-cache-persistence 包。

例:

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

useIdentityPlugin(cachePersistencePlugin);

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

属性详细信息

tokenCachePersistenceOptions

存储凭据时提供给持久性层的选项(如果有)。

必须首先注册持久性提供程序插件。 请参阅 NPM 上的 @azure/identity-cache-persistence 包。

例:

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

useIdentityPlugin(cachePersistencePlugin);

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

属性值