fix: update getAzureIdentityAuthProvider and make tenant id and client id optional.
This commit is contained in:
1 parent
97f7011f97
commit
059fc3c1da
1 file changed
+9
-8
+9
-8
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user