@azure/identity-cache-persistence package

İşlevler

cachePersistencePlugin(unknown)

@azure/identity kimlik bilgileri için kalıcı belirteç önbelleğe alma sağlayan eklenti. Eklenti API'si, @azure/identity 2.0.0 ve üzeri sürümlerle uyumludur. @azure/identity'dan içeri aktarılan useIdentityPlugin işlevini kullanarak bu eklentiyi yükleyin.

Bu işlevi etkinleştirmek için tokenCachePersistenceOptionsenabled özelliği true olarak ayarlanmış kimlik bilgisi oluşturucularınıza da geçirmeniz gerekir.

Örnek:

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), "...");

İşlev Ayrıntıları

cachePersistencePlugin(unknown)

@azure/identity kimlik bilgileri için kalıcı belirteç önbelleğe alma sağlayan eklenti. Eklenti API'si, @azure/identity 2.0.0 ve üzeri sürümlerle uyumludur. @azure/identity'dan içeri aktarılan useIdentityPlugin işlevini kullanarak bu eklentiyi yükleyin.

Bu işlevi etkinleştirmek için tokenCachePersistenceOptionsenabled özelliği true olarak ayarlanmış kimlik bilgisi oluşturucularınıza da geçirmeniz gerekir.

Örnek:

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)

Parametreler

context

unknown