@azure/identity-cache-persistence package
関数
| cache |
この機能を有効にするには、 例:
|
関数の詳細
cachePersistencePlugin(unknown)
@azure/identity 資格情報の永続的なトークン キャッシュを提供するプラグイン。 プラグイン API は、@azure/identity バージョン 2.0.0 以降と互換性があります。
@azure/identityからインポートした useIdentityPlugin 関数を使用して、このプラグインを読み込みます。
この機能を有効にするには、enabled プロパティを true に設定して資格情報コンストラクターに tokenCachePersistenceOptions を渡す必要もあります。
例:
import { DeviceCodeCredential } from "@azure/identity";
const credential = new DeviceCodeCredential({
tokenCachePersistenceOptions: {
enabled: true,
},
});
// We'll use the Microsoft Graph scope as an example
const scope = "https://graph.microsoft.com/.default";
// Print out part of the access token
console.log((await credential.getToken(scope)).token.substring(0, 10), "...");
function cachePersistencePlugin(context: unknown)
パラメーター
- context
-
unknown