@azure/msal-common
Advanced tools
Comparing version 6.4.0 to 7.0.0
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /*! ***************************************************************************** |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { ClientAuthError } from '../error/ClientAuthError.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { ClientAuthError } from '../error/ClientAuthError.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js'; |
@@ -180,3 +180,3 @@ import { AccountCache, AccountFilter, CredentialFilter, CredentialCache, ValidCredentialType, AppMetadataFilter, AppMetadataCache } from "./utils/CacheTypes"; | ||
* @param target | ||
* @param oboAssertion | ||
* @param userAssertionHash | ||
* @param tokenType | ||
@@ -281,3 +281,3 @@ */ | ||
*/ | ||
private matchOboAssertion; | ||
private matchUserAssertionHash; | ||
/** | ||
@@ -284,0 +284,0 @@ * helper to match environment |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -173,3 +173,3 @@ import { __awaiter, __generator, __extends } from '../_virtual/_tslib.js'; | ||
CacheManager.prototype.getCredentialsFilteredBy = function (filter) { | ||
return this.getCredentialsFilteredByInternal(filter.homeAccountId, filter.environment, filter.credentialType, filter.clientId, filter.familyId, filter.realm, filter.target, filter.oboAssertion, filter.tokenType, filter.keyId, filter.requestedClaimsHash); | ||
return this.getCredentialsFilteredByInternal(filter.homeAccountId, filter.environment, filter.credentialType, filter.clientId, filter.familyId, filter.realm, filter.target, filter.userAssertionHash, filter.tokenType, filter.keyId, filter.requestedClaimsHash); | ||
}; | ||
@@ -184,6 +184,6 @@ /** | ||
* @param target | ||
* @param oboAssertion | ||
* @param userAssertionHash | ||
* @param tokenType | ||
*/ | ||
CacheManager.prototype.getCredentialsFilteredByInternal = function (homeAccountId, environment, credentialType, clientId, familyId, realm, target, oboAssertion, tokenType, keyId, requestedClaimsHash) { | ||
CacheManager.prototype.getCredentialsFilteredByInternal = function (homeAccountId, environment, credentialType, clientId, familyId, realm, target, userAssertionHash, tokenType, keyId, requestedClaimsHash) { | ||
var _this = this; | ||
@@ -207,3 +207,3 @@ var allCacheKeys = this.getKeys(); | ||
} | ||
if (!!oboAssertion && !_this.matchOboAssertion(entity, oboAssertion)) { | ||
if (!!userAssertionHash && !_this.matchUserAssertionHash(entity, userAssertionHash)) { | ||
return; | ||
@@ -539,3 +539,3 @@ } | ||
keyId: request.sshKid, | ||
requestedClaimsHash: request.requestedClaimsHash | ||
requestedClaimsHash: request.requestedClaimsHash, | ||
}; | ||
@@ -566,3 +566,3 @@ var credentialCache = this.getCredentialsFilteredBy(accessTokenFilter); | ||
clientId: clientId, | ||
familyId: id | ||
familyId: id, | ||
}; | ||
@@ -619,4 +619,4 @@ var credentialCache = this.getCredentialsFilteredBy(refreshTokenFilter); | ||
*/ | ||
CacheManager.prototype.matchOboAssertion = function (entity, oboAssertion) { | ||
return !!(entity.oboAssertion && oboAssertion === entity.oboAssertion); | ||
CacheManager.prototype.matchUserAssertionHash = function (entity, userAssertionHash) { | ||
return !!(entity.userAssertionHash && userAssertionHash === entity.userAssertionHash); | ||
}; | ||
@@ -623,0 +623,0 @@ /** |
@@ -50,3 +50,3 @@ import { CredentialEntity } from "./CredentialEntity"; | ||
*/ | ||
static createAccessTokenEntity(homeAccountId: string, environment: string, accessToken: string, clientId: string, tenantId: string, scopes: string, expiresOn: number, extExpiresOn: number, cryptoUtils: ICrypto, refreshOn?: number, tokenType?: AuthenticationScheme, oboAssertion?: string, keyId?: string, requestedClaims?: string, requestedClaimsHash?: string): AccessTokenEntity; | ||
static createAccessTokenEntity(homeAccountId: string, environment: string, accessToken: string, clientId: string, tenantId: string, scopes: string, expiresOn: number, extExpiresOn: number, cryptoUtils: ICrypto, refreshOn?: number, tokenType?: AuthenticationScheme, userAssertionHash?: string, keyId?: string, requestedClaims?: string, requestedClaimsHash?: string): AccessTokenEntity; | ||
/** | ||
@@ -53,0 +53,0 @@ * Validates an entity: checks for all expected params |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -55,3 +55,3 @@ import { __extends } from '../../_virtual/_tslib.js'; | ||
*/ | ||
AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, oboAssertion, keyId, requestedClaims, requestedClaimsHash) { | ||
AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) { | ||
var _a, _b; | ||
@@ -77,3 +77,3 @@ var atEntity = new AccessTokenEntity(); | ||
atEntity.target = scopes; | ||
atEntity.oboAssertion = oboAssertion; | ||
atEntity.userAssertionHash = userAssertionHash; | ||
atEntity.tokenType = StringUtils.isEmpty(tokenType) ? AuthenticationScheme.BEARER : tokenType; | ||
@@ -80,0 +80,0 @@ if (requestedClaims) { |
@@ -27,3 +27,2 @@ import { Authority } from "../../authority/Authority"; | ||
* lastModificationApp: | ||
* oboAssertion: access token passed in as part of OBO request | ||
* idTokenClaims: Object containing claims parsed from ID token | ||
@@ -44,3 +43,2 @@ * nativeAccountId: Account identifier on the native device | ||
lastModificationApp?: string; | ||
oboAssertion?: string; | ||
cloudGraphHostName?: string; | ||
@@ -78,3 +76,3 @@ msGraphHost?: string; | ||
*/ | ||
static createAccount(clientInfo: string, homeAccountId: string, idToken: AuthToken, authority?: Authority, oboAssertion?: string, cloudGraphHostName?: string, msGraphHost?: string, environment?: string, nativeAccountId?: string): AccountEntity; | ||
static createAccount(clientInfo: string, homeAccountId: string, idToken: AuthToken, authority?: Authority, cloudGraphHostName?: string, msGraphHost?: string, environment?: string, nativeAccountId?: string): AccountEntity; | ||
/** | ||
@@ -85,3 +83,3 @@ * Builds non-AAD/ADFS account. | ||
*/ | ||
static createGenericAccount(homeAccountId: string, idToken: AuthToken, authority?: Authority, oboAssertion?: string, cloudGraphHostName?: string, msGraphHost?: string, environment?: string): AccountEntity; | ||
static createGenericAccount(homeAccountId: string, idToken: AuthToken, authority?: Authority, cloudGraphHostName?: string, msGraphHost?: string, environment?: string): AccountEntity; | ||
/** | ||
@@ -88,0 +86,0 @@ * Generate HomeAccountId from server response |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -32,3 +32,2 @@ import { Separators, CacheAccountType, CacheType, Constants } from '../../utils/Constants.js'; | ||
* lastModificationApp: | ||
* oboAssertion: access token passed in as part of OBO request | ||
* idTokenClaims: Object containing claims parsed from ID token | ||
@@ -112,3 +111,3 @@ * nativeAccountId: Account identifier on the native device | ||
*/ | ||
AccountEntity.createAccount = function (clientInfo, homeAccountId, idToken, authority, oboAssertion, cloudGraphHostName, msGraphHost, environment, nativeAccountId) { | ||
AccountEntity.createAccount = function (clientInfo, homeAccountId, idToken, authority, cloudGraphHostName, msGraphHost, environment, nativeAccountId) { | ||
var _a, _b, _c, _d, _e, _f; | ||
@@ -127,3 +126,2 @@ var account = new AccountEntity(); | ||
account.realm = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.tid) || Constants.EMPTY_STRING; | ||
account.oboAssertion = oboAssertion; | ||
if (idToken) { | ||
@@ -149,3 +147,3 @@ account.idTokenClaims = idToken.claims; | ||
*/ | ||
AccountEntity.createGenericAccount = function (homeAccountId, idToken, authority, oboAssertion, cloudGraphHostName, msGraphHost, environment) { | ||
AccountEntity.createGenericAccount = function (homeAccountId, idToken, authority, cloudGraphHostName, msGraphHost, environment) { | ||
var _a, _b, _c, _d; | ||
@@ -157,3 +155,2 @@ var account = new AccountEntity(); | ||
account.realm = Constants.EMPTY_STRING; | ||
account.oboAssertion = oboAssertion; | ||
var env = environment || authority && authority.getPreferredCache(); | ||
@@ -160,0 +157,0 @@ if (!env) { |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { Separators, APP_METADATA } from '../../utils/Constants.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { AUTHORITY_METADATA_CONSTANTS } from '../../utils/Constants.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -19,5 +19,5 @@ import { CredentialType, AuthenticationScheme } from "../../utils/Constants"; | ||
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier. | ||
* oboAssertion: access token passed in as part of OBO request | ||
* tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop) | ||
* requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request | ||
* userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow | ||
* } | ||
@@ -34,3 +34,3 @@ */ | ||
target?: string; | ||
oboAssertion?: string; | ||
userAssertionHash?: string; | ||
tokenType?: AuthenticationScheme; | ||
@@ -37,0 +37,0 @@ keyId?: string; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -27,5 +27,5 @@ import { CredentialType, CacheType, Constants, Separators, AuthenticationScheme } from '../../utils/Constants.js'; | ||
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier. | ||
* oboAssertion: access token passed in as part of OBO request | ||
* tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop) | ||
* requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request | ||
* userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow | ||
* } | ||
@@ -32,0 +32,0 @@ */ |
@@ -28,3 +28,3 @@ import { CredentialEntity } from "./CredentialEntity"; | ||
*/ | ||
static createIdTokenEntity(homeAccountId: string, environment: string, idToken: string, clientId: string, tenantId: string, oboAssertion?: string): IdTokenEntity; | ||
static createIdTokenEntity(homeAccountId: string, environment: string, idToken: string, clientId: string, tenantId: string): IdTokenEntity; | ||
/** | ||
@@ -31,0 +31,0 @@ * Validates an entity: checks for all expected params |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -40,3 +40,3 @@ import { __extends } from '../../_virtual/_tslib.js'; | ||
*/ | ||
IdTokenEntity.createIdTokenEntity = function (homeAccountId, environment, idToken, clientId, tenantId, oboAssertion) { | ||
IdTokenEntity.createIdTokenEntity = function (homeAccountId, environment, idToken, clientId, tenantId) { | ||
var idTokenEntity = new IdTokenEntity(); | ||
@@ -49,3 +49,2 @@ idTokenEntity.credentialType = CredentialType.ID_TOKEN; | ||
idTokenEntity.realm = tenantId; | ||
idTokenEntity.oboAssertion = oboAssertion; | ||
return idTokenEntity; | ||
@@ -52,0 +51,0 @@ }; |
@@ -30,3 +30,3 @@ import { CredentialEntity } from "./CredentialEntity"; | ||
*/ | ||
static createRefreshTokenEntity(homeAccountId: string, environment: string, refreshToken: string, clientId: string, familyId?: string, oboAssertion?: string): RefreshTokenEntity; | ||
static createRefreshTokenEntity(homeAccountId: string, environment: string, refreshToken: string, clientId: string, familyId?: string, userAssertionHash?: string): RefreshTokenEntity; | ||
/** | ||
@@ -33,0 +33,0 @@ * Validates an entity: checks for all expected params |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -42,3 +42,3 @@ import { __extends } from '../../_virtual/_tslib.js'; | ||
*/ | ||
RefreshTokenEntity.createRefreshTokenEntity = function (homeAccountId, environment, refreshToken, clientId, familyId, oboAssertion) { | ||
RefreshTokenEntity.createRefreshTokenEntity = function (homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash) { | ||
var rtEntity = new RefreshTokenEntity(); | ||
@@ -50,3 +50,3 @@ rtEntity.clientId = clientId; | ||
rtEntity.secret = refreshToken; | ||
rtEntity.oboAssertion = oboAssertion; | ||
rtEntity.userAssertionHash = userAssertionHash; | ||
if (familyId) | ||
@@ -53,0 +53,0 @@ rtEntity.familyId = familyId; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { SERVER_TELEM_CONSTANTS } from '../../utils/Constants.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { ThrottlingConstants } from '../../utils/Constants.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -47,3 +47,3 @@ import { AccountEntity } from "../entities/AccountEntity"; | ||
target?: string; | ||
oboAssertion?: string; | ||
userAssertionHash?: string; | ||
tokenType?: AuthenticationScheme; | ||
@@ -50,0 +50,0 @@ keyId?: string; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -220,4 +220,4 @@ import { __extends, __awaiter, __generator, __assign, __spreadArrays } from '../_virtual/_tslib.js'; | ||
} | ||
clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion; | ||
if (clientAssertion) { | ||
if (this.config.clientCredentials.clientAssertion) { | ||
clientAssertion = this.config.clientCredentials.clientAssertion; | ||
parameterBuilder.addClientAssertion(clientAssertion.assertion); | ||
@@ -224,0 +224,0 @@ parameterBuilder.addClientAssertionType(clientAssertion.assertionType); |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js'; |
@@ -10,2 +10,3 @@ import { ClientConfiguration } from "../config/ClientConfiguration"; | ||
private scopeSet; | ||
private userAssertionHash; | ||
constructor(configuration: ClientConfiguration); | ||
@@ -19,2 +20,6 @@ /** | ||
* look up cache for tokens | ||
* Find idtoken in the cache | ||
* Find accessToken based on user assertion and account info in the cache | ||
* Please note we are not yet supported OBO tokens refreshed with long lived RT. User will have to send a new assertion if the current access token expires | ||
* This is to prevent security issues when the assertion changes over time, however, longlived RT helps retaining the session | ||
* @param request | ||
@@ -24,17 +29,15 @@ */ | ||
/** | ||
* read access token from cache TODO: CacheManager API should be used here | ||
* read idtoken from cache, this is a specific implementation for OBO as the requirements differ from a generic lookup in the cacheManager | ||
* Certain use cases of OBO flow do not expect an idToken in the cache/or from the service | ||
* @param request | ||
*/ | ||
private readAccessTokenFromCache; | ||
private readIdTokenFromCacheForOBO; | ||
/** | ||
* read idtoken from cache TODO: CacheManager API should be used here instead | ||
* Fetches the cached access token based on incoming assertion | ||
* @param clientId | ||
* @param request | ||
* @param userAssertionHash | ||
*/ | ||
private readIdTokenFromCache; | ||
private readAccessTokenFromCacheForOBO; | ||
/** | ||
* read account from cache, TODO: CacheManager API should be used here instead | ||
* @param account | ||
*/ | ||
private readAccountFromCache; | ||
/** | ||
* Make a network call to the server requesting credentials | ||
@@ -41,0 +44,0 @@ * @param request |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -7,3 +7,3 @@ import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js'; | ||
import { ScopeSet } from '../request/ScopeSet.js'; | ||
import { CredentialType, GrantType, AADServerParamKeys, CacheOutcome, Constants } from '../utils/Constants.js'; | ||
import { AuthenticationScheme, CredentialType, GrantType, AADServerParamKeys, CacheOutcome, Constants } from '../utils/Constants.js'; | ||
import { ResponseHandler } from '../response/ResponseHandler.js'; | ||
@@ -32,17 +32,27 @@ import { TimeUtils } from '../utils/TimeUtils.js'; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var cachedAuthenticationResult; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
this.scopeSet = new ScopeSet(request.scopes || []); | ||
if (!request.skipCache) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, this.executeTokenRequest(request, this.authority)]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
case 2: return [4 /*yield*/, this.getCachedAuthenticationResult(request)]; | ||
// generate the user_assertion_hash for OBOAssertion | ||
_a = this; | ||
return [4 /*yield*/, this.cryptoUtils.hashString(request.oboAssertion)]; | ||
case 1: | ||
// generate the user_assertion_hash for OBOAssertion | ||
_a.userAssertionHash = _b.sent(); | ||
if (!request.skipCache) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, this.executeTokenRequest(request, this.authority, this.userAssertionHash)]; | ||
case 2: return [2 /*return*/, _b.sent()]; | ||
case 3: | ||
cachedAuthenticationResult = _a.sent(); | ||
if (!cachedAuthenticationResult) return [3 /*break*/, 4]; | ||
return [2 /*return*/, cachedAuthenticationResult]; | ||
case 4: return [4 /*yield*/, this.executeTokenRequest(request, this.authority)]; | ||
case 5: return [2 /*return*/, _a.sent()]; | ||
_b.trys.push([3, 5, , 7]); | ||
return [4 /*yield*/, this.getCachedAuthenticationResult(request)]; | ||
case 4: return [2 /*return*/, _b.sent()]; | ||
case 5: | ||
_b.sent(); | ||
return [4 /*yield*/, this.executeTokenRequest(request, this.authority, this.userAssertionHash)]; | ||
case 6: | ||
// Any failure falls back to interactive request, once we implement distributed cache, we plan to handle `createRefreshRequiredError` to refresh using the RT | ||
return [2 /*return*/, _b.sent()]; | ||
case 7: return [2 /*return*/]; | ||
} | ||
@@ -54,19 +64,29 @@ }); | ||
* look up cache for tokens | ||
* Find idtoken in the cache | ||
* Find accessToken based on user assertion and account info in the cache | ||
* Please note we are not yet supported OBO tokens refreshed with long lived RT. User will have to send a new assertion if the current access token expires | ||
* This is to prevent security issues when the assertion changes over time, however, longlived RT helps retaining the session | ||
* @param request | ||
*/ | ||
OnBehalfOfClient.prototype.getCachedAuthenticationResult = function (request) { | ||
var _a; | ||
var _a, _b; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var cachedAccessToken, cachedIdToken, idTokenObject, cachedAccount, localAccountId, accountInfo; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
cachedAccessToken = this.readAccessTokenFromCache(); | ||
if (!cachedAccessToken || | ||
TimeUtils.isTokenExpired(cachedAccessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) { | ||
// Update the server telemetry outcome | ||
(_a = this.serverTelemetryManager) === null || _a === void 0 ? void 0 : _a.setCacheOutcome(!cachedAccessToken ? CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED : CacheOutcome.NO_CACHED_ACCESS_TOKEN); | ||
return [2 /*return*/, null]; | ||
cachedAccessToken = this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId, request); | ||
if (!cachedAccessToken) { | ||
// Must refresh due to non-existent access_token. | ||
(_a = this.serverTelemetryManager) === null || _a === void 0 ? void 0 : _a.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN); | ||
this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."); | ||
throw ClientAuthError.createRefreshRequiredError(); | ||
} | ||
cachedIdToken = this.readIdTokenFromCache(request); | ||
else if (TimeUtils.isTokenExpired(cachedAccessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) { | ||
// Access token expired, will need to renewed | ||
(_b = this.serverTelemetryManager) === null || _b === void 0 ? void 0 : _b.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED); | ||
this.logger.info("OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within " + this.config.systemOptions.tokenRenewalOffsetSeconds + " seconds."); | ||
throw ClientAuthError.createRefreshRequiredError(); | ||
} | ||
cachedIdToken = this.readIdTokenFromCacheForOBO(request, cachedAccessToken.homeAccountId); | ||
cachedAccount = null; | ||
@@ -83,4 +103,8 @@ if (cachedIdToken) { | ||
}; | ||
cachedAccount = this.readAccountFromCache(accountInfo); | ||
cachedAccount = this.cacheManager.readAccountFromCache(accountInfo); | ||
} | ||
// increment telemetry cache hit counter | ||
if (this.config.serverTelemetryManager) { | ||
this.config.serverTelemetryManager.incrementCacheHits(); | ||
} | ||
return [4 /*yield*/, ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, { | ||
@@ -93,3 +117,3 @@ account: cachedAccount, | ||
}, true, request, idTokenObject)]; | ||
case 1: return [2 /*return*/, _b.sent()]; | ||
case 1: return [2 /*return*/, _c.sent()]; | ||
} | ||
@@ -100,35 +124,13 @@ }); | ||
/** | ||
* read access token from cache TODO: CacheManager API should be used here | ||
* read idtoken from cache, this is a specific implementation for OBO as the requirements differ from a generic lookup in the cacheManager | ||
* Certain use cases of OBO flow do not expect an idToken in the cache/or from the service | ||
* @param request | ||
*/ | ||
OnBehalfOfClient.prototype.readAccessTokenFromCache = function () { | ||
var accessTokenFilter = { | ||
environment: this.authority.canonicalAuthorityUrlComponents.HostNameAndPort, | ||
credentialType: CredentialType.ACCESS_TOKEN, | ||
clientId: this.config.authOptions.clientId, | ||
realm: this.authority.tenant, | ||
target: this.scopeSet.printScopesLowerCase(), | ||
}; | ||
var credentialCache = this.cacheManager.getCredentialsFilteredBy(accessTokenFilter); | ||
var accessTokens = Object.keys(credentialCache.accessTokens).map(function (key) { return credentialCache.accessTokens[key]; }); | ||
var numAccessTokens = accessTokens.length; | ||
if (numAccessTokens < 1) { | ||
return null; | ||
} | ||
else if (numAccessTokens > 1) { | ||
throw ClientAuthError.createMultipleMatchingTokensInCacheError(); | ||
} | ||
return accessTokens[0]; | ||
}; | ||
/** | ||
* read idtoken from cache TODO: CacheManager API should be used here instead | ||
* @param request | ||
*/ | ||
OnBehalfOfClient.prototype.readIdTokenFromCache = function (request) { | ||
OnBehalfOfClient.prototype.readIdTokenFromCacheForOBO = function (request, atHomeAccountId) { | ||
var idTokenFilter = { | ||
homeAccountId: atHomeAccountId, | ||
environment: this.authority.canonicalAuthorityUrlComponents.HostNameAndPort, | ||
credentialType: CredentialType.ID_TOKEN, | ||
clientId: this.config.authOptions.clientId, | ||
realm: this.authority.tenant, | ||
oboAssertion: request.oboAssertion | ||
realm: this.authority.tenant | ||
}; | ||
@@ -144,7 +146,33 @@ var credentialCache = this.cacheManager.getCredentialsFilteredBy(idTokenFilter); | ||
/** | ||
* read account from cache, TODO: CacheManager API should be used here instead | ||
* @param account | ||
* Fetches the cached access token based on incoming assertion | ||
* @param clientId | ||
* @param request | ||
* @param userAssertionHash | ||
*/ | ||
OnBehalfOfClient.prototype.readAccountFromCache = function (account) { | ||
return this.cacheManager.readAccountFromCache(account); | ||
OnBehalfOfClient.prototype.readAccessTokenFromCacheForOBO = function (clientId, request) { | ||
var authScheme = request.authenticationScheme || AuthenticationScheme.BEARER; | ||
/* | ||
* Distinguish between Bearer and PoP/SSH token cache types | ||
* Cast to lowercase to handle "bearer" from ADFS | ||
*/ | ||
var credentialType = (authScheme && authScheme.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME : CredentialType.ACCESS_TOKEN; | ||
var accessTokenFilter = { | ||
credentialType: credentialType, | ||
clientId: clientId, | ||
target: this.scopeSet.printScopesLowerCase(), | ||
tokenType: authScheme, | ||
keyId: request.sshKid, | ||
requestedClaimsHash: request.requestedClaimsHash, | ||
userAssertionHash: this.userAssertionHash | ||
}; | ||
var credentialCache = this.cacheManager.getCredentialsFilteredBy(accessTokenFilter); | ||
var accessTokens = Object.keys(credentialCache.accessTokens).map(function (key) { return credentialCache.accessTokens[key]; }); | ||
var numAccessTokens = accessTokens.length; | ||
if (numAccessTokens < 1) { | ||
return null; | ||
} | ||
else if (numAccessTokens > 1) { | ||
throw ClientAuthError.createMultipleMatchingTokensInCacheError(); | ||
} | ||
return accessTokens[0]; | ||
}; | ||
@@ -156,3 +184,3 @@ /** | ||
*/ | ||
OnBehalfOfClient.prototype.executeTokenRequest = function (request, authority) { | ||
OnBehalfOfClient.prototype.executeTokenRequest = function (request, authority, userAssertionHash) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -182,3 +210,3 @@ var requestBody, headers, thumbprint, reqTimestamp, response, responseHandler, tokenResponse; | ||
responseHandler.validateTokenResponse(response.body); | ||
return [4 /*yield*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request)]; | ||
return [4 /*yield*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, userAssertionHash)]; | ||
case 2: | ||
@@ -214,5 +242,4 @@ tokenResponse = _a.sent(); | ||
} | ||
// Use clientAssertion from request, fallback to client assertion in base configuration | ||
var clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion; | ||
if (clientAssertion) { | ||
if (this.config.clientCredentials.clientAssertion) { | ||
var clientAssertion = this.config.clientCredentials.clientAssertion; | ||
parameterBuilder.addClientAssertion(clientAssertion.assertion); | ||
@@ -219,0 +246,0 @@ parameterBuilder.addClientAssertionType(clientAssertion.assertionType); |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -179,4 +179,4 @@ import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js'; | ||
} | ||
clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion; | ||
if (clientAssertion) { | ||
if (this.config.clientCredentials.clientAssertion) { | ||
clientAssertion = this.config.clientCredentials.clientAssertion; | ||
parameterBuilder.addClientAssertion(clientAssertion.assertion); | ||
@@ -183,0 +183,0 @@ parameterBuilder.addClientAssertionType(clientAssertion.assertionType); |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -103,5 +103,4 @@ import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js'; | ||
} | ||
// Use clientAssertion from request, fallback to client assertion in base configuration | ||
var clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion; | ||
if (clientAssertion) { | ||
if (this.config.clientCredentials.clientAssertion) { | ||
var clientAssertion = this.config.clientCredentials.clientAssertion; | ||
parameterBuilder.addClientAssertion(clientAssertion.assertion); | ||
@@ -108,0 +107,0 @@ parameterBuilder.addClientAssertionType(clientAssertion.assertionType); |
@@ -10,2 +10,3 @@ import { INetworkModule } from "../network/INetworkModule"; | ||
import { ISerializableTokenCache } from "../cache/interface/ISerializableTokenCache"; | ||
import { ClientCredentials } from "../account/ClientCredentials"; | ||
/** | ||
@@ -103,13 +104,2 @@ * Use the configuration object to configure MSAL Modules and initialize the base interfaces for MSAL. | ||
/** | ||
* Credentials for confidential clients | ||
*/ | ||
export declare type ClientAssertion = { | ||
assertion: string; | ||
assertionType: string; | ||
}; | ||
export declare type ClientCredentials = { | ||
clientSecret?: string; | ||
clientAssertion?: ClientAssertion; | ||
}; | ||
/** | ||
* AzureCloudInstance specific options | ||
@@ -116,0 +106,0 @@ * |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __assign, __awaiter, __generator } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { JoseHeaderError } from '../error/JoseHeaderError.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ export { AuthorizationCodeClient } from './client/AuthorizationCodeClient.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { StringUtils } from '../utils/StringUtils.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { AuthError } from '../error/AuthError.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { ThrottlingConstants, CacheSchemaType, Constants, HeaderNames } from '../utils/Constants.js'; |
export declare const name = "@azure/msal-common"; | ||
export declare const version = "6.4.0"; | ||
export declare const version = "7.0.0"; | ||
//# sourceMappingURL=packageMetadata.d.ts.map |
@@ -1,8 +0,8 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
/* eslint-disable header/header */ | ||
var name = "@azure/msal-common"; | ||
var version = "6.4.0"; | ||
var version = "7.0.0"; | ||
export { name, version }; | ||
//# sourceMappingURL=packageMetadata.js.map |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { ClientConfigurationError } from '../error/ClientConfigurationError.js'; |
import { AuthenticationScheme } from "../utils/Constants"; | ||
import { AzureCloudOptions, ClientAssertion } from "../config/ClientConfiguration"; | ||
import { AzureCloudOptions } from "../config/ClientConfiguration"; | ||
/** | ||
@@ -18,3 +18,2 @@ * BaseAuthRequest | ||
* - requestedClaimsHash - SHA 256 hash string of the requested claims string, used as part of an access token cache key so tokens can be filtered by requested claims | ||
* - clientAssertion - Client assertion passed by the user for confidential client flows | ||
*/ | ||
@@ -35,4 +34,3 @@ export declare type BaseAuthRequest = { | ||
requestedClaimsHash?: string; | ||
clientAssertion?: ClientAssertion; | ||
}; | ||
//# sourceMappingURL=BaseAuthRequest.d.ts.map |
import { BaseAuthRequest } from "./BaseAuthRequest"; | ||
import { AzureRegion } from "../authority/AzureRegion"; | ||
import { ClientAssertion } from "../account/ClientCredentials"; | ||
/** | ||
@@ -14,3 +15,4 @@ * CommonClientCredentialRequest | ||
azureRegion?: AzureRegion; | ||
clientAssertion?: ClientAssertion; | ||
}; | ||
//# sourceMappingURL=CommonClientCredentialRequest.d.ts.map |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -242,3 +242,5 @@ import { __spreadArrays } from '../_virtual/_tslib.js'; | ||
RequestParameterBuilder.prototype.addClientAssertion = function (clientAssertion) { | ||
this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion)); | ||
if (!StringUtils.isEmpty(clientAssertion)) { | ||
this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion)); | ||
} | ||
}; | ||
@@ -250,3 +252,5 @@ /** | ||
RequestParameterBuilder.prototype.addClientAssertionType = function (clientAssertionType) { | ||
this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType)); | ||
if (!StringUtils.isEmpty(clientAssertionType)) { | ||
this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType)); | ||
} | ||
}; | ||
@@ -253,0 +257,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { StringUtils } from '../utils/StringUtils.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __spreadArrays } from '../_virtual/_tslib.js'; |
@@ -44,3 +44,3 @@ import { ServerAuthorizationTokenResponse } from "./ServerAuthorizationTokenResponse"; | ||
*/ | ||
handleServerTokenResponse(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, reqTimestamp: number, request: BaseAuthRequest, authCodePayload?: AuthorizationCodePayload, oboAssertion?: string, handlingRefreshTokenResponse?: boolean): Promise<AuthenticationResult>; | ||
handleServerTokenResponse(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, reqTimestamp: number, request: BaseAuthRequest, authCodePayload?: AuthorizationCodePayload, userAssertionHash?: string, handlingRefreshTokenResponse?: boolean): Promise<AuthenticationResult>; | ||
/** | ||
@@ -47,0 +47,0 @@ * Generates CacheRecord |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -82,3 +82,3 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js'; | ||
*/ | ||
ResponseHandler.prototype.handleServerTokenResponse = function (serverTokenResponse, authority, reqTimestamp, request, authCodePayload, oboAssertion, handlingRefreshTokenResponse) { | ||
ResponseHandler.prototype.handleServerTokenResponse = function (serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -105,3 +105,3 @@ var idTokenObj, requestStateObj, cacheRecord, cacheContext, key, account; | ||
serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined; | ||
cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, oboAssertion, authCodePayload); | ||
cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload); | ||
_a.label = 1; | ||
@@ -154,3 +154,3 @@ case 1: | ||
*/ | ||
ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj, oboAssertion, authCodePayload) { | ||
ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload) { | ||
var env = authority.getPreferredCache(); | ||
@@ -164,4 +164,4 @@ if (StringUtils.isEmpty(env)) { | ||
if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) { | ||
cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING, oboAssertion); | ||
cachedAccount = this.generateAccountEntity(serverTokenResponse, idTokenObj, authority, oboAssertion, authCodePayload); | ||
cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING); | ||
cachedAccount = this.generateAccountEntity(serverTokenResponse, idTokenObj, authority, authCodePayload); | ||
} | ||
@@ -184,3 +184,3 @@ // AccessToken | ||
// non AAD scenarios can have empty realm | ||
cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, oboAssertion, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash); | ||
cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, userAssertionHash, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash); | ||
} | ||
@@ -190,3 +190,3 @@ // refreshToken | ||
if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) { | ||
cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token || Constants.EMPTY_STRING, this.clientId, serverTokenResponse.foci, oboAssertion); | ||
cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token || Constants.EMPTY_STRING, this.clientId, serverTokenResponse.foci, userAssertionHash); | ||
} | ||
@@ -206,3 +206,3 @@ // appMetadata | ||
*/ | ||
ResponseHandler.prototype.generateAccountEntity = function (serverTokenResponse, idToken, authority, oboAssertion, authCodePayload) { | ||
ResponseHandler.prototype.generateAccountEntity = function (serverTokenResponse, idToken, authority, authCodePayload) { | ||
var authorityType = authority.authorityType; | ||
@@ -214,3 +214,3 @@ var cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING; | ||
this.logger.verbose("Authority type is ADFS, creating ADFS account"); | ||
return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, oboAssertion, cloudGraphHostName, msGraphhost); | ||
return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost); | ||
} | ||
@@ -222,4 +222,4 @@ // This fallback applies to B2C as well as they fall under an AAD account type. | ||
return serverTokenResponse.client_info ? | ||
AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, oboAssertion, cloudGraphHostName, msGraphhost) : | ||
AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, oboAssertion, cloudGraphHostName, msGraphhost); | ||
AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost) : | ||
AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost); | ||
}; | ||
@@ -226,0 +226,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __assign } from '../../_virtual/_tslib.js'; |
@@ -173,2 +173,14 @@ /** | ||
/** | ||
* Add specific error code in case of failure | ||
* | ||
* @type {string} | ||
*/ | ||
errorCode?: string; | ||
/** | ||
* Add specific sub error code in case of failure | ||
* | ||
* @type {string} | ||
*/ | ||
subErrorCode?: string; | ||
/** | ||
* Name of the library used for the operation. | ||
@@ -175,0 +187,0 @@ * |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __extends } from '../../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { SERVER_TELEM_CONSTANTS, CacheOutcome, Constants, Separators } from '../../utils/Constants.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { ClientConfigurationError } from '../error/ClientConfigurationError.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { __spreadArrays } from '../_virtual/_tslib.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { StringUtils } from './StringUtils.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ import { ClientAuthError } from '../error/ClientAuthError.js'; |
@@ -1,2 +0,2 @@ | ||
/*! @azure/msal-common v6.4.0 2022-06-06 */ | ||
/*! @azure/msal-common v7.0.0 2022-06-13 */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ /* |
@@ -13,3 +13,3 @@ { | ||
}, | ||
"version": "6.4.0", | ||
"version": "7.0.0", | ||
"description": "Microsoft Authentication Library for js", | ||
@@ -16,0 +16,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2206917
327
21647