fix: update getAzureIdentityAuthProvider and make tenant id and client id optional.

This commit is contained in:
2026-03-10 20:28:41 +01:00
parent 97f7011f97
commit 059fc3c1da

View File

@@ -32,14 +32,15 @@ export function getMsalAuthProvider(
};
}
export function getAzureIdentityAuthProvider(
tenantId: string,
clientId: string,
) {
const credential = new DefaultAzureCredential({
tenantId,
managedIdentityClientId: clientId,
});
export function getAzureIdentityAuthProvider(tenantId?: string, clientId?: string) : GraphAuthProvider {
const credentialOptions =
tenantId && clientId
? { tenantId, managedIdentityClientId: clientId }
: undefined;
const credential = credentialOptions
? new DefaultAzureCredential(credentialOptions)
: new DefaultAzureCredential();
const getBearerToken = getBearerTokenProvider(
credential,