Commit iniziale
This commit is contained in:
25
node_modules/@azure/msal-common/dist/account/TokenClaims.mjs
generated
vendored
Normal file
25
node_modules/@azure/msal-common/dist/account/TokenClaims.mjs
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
||||
'use strict';
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* Gets tenantId from available ID token claims to set as credential realm with the following precedence:
|
||||
* 1. tid - if the token is acquired from an Azure AD tenant tid will be present
|
||||
* 2. tfp - if the token is acquired from a modern B2C tenant tfp should be present
|
||||
* 3. acr - if the token is acquired from a legacy B2C tenant acr should be present
|
||||
* Downcased to match the realm case-insensitive comparison requirements
|
||||
* @param idTokenClaims
|
||||
* @returns
|
||||
*/
|
||||
function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
||||
if (idTokenClaims) {
|
||||
const tenantId = idTokenClaims.tid || idTokenClaims.tfp || idTokenClaims.acr;
|
||||
return tenantId || null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export { getTenantIdFromIdTokenClaims };
|
||||
//# sourceMappingURL=TokenClaims.mjs.map
|
||||
Reference in New Issue
Block a user