@azure/msal-common 4.5.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +194 -0
- package/{changelog.md → CHANGELOG.md} +61 -1
- package/README.md +7 -6
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/account/AuthToken.js +1 -1
- package/dist/account/CcsCredential.js +1 -1
- package/dist/account/ClientInfo.js +1 -1
- package/dist/account/TokenClaims.d.ts +5 -0
- package/dist/account/TokenClaims.d.ts.map +1 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.js +8 -2
- package/dist/authority/Authority.js.map +1 -1
- package/dist/authority/AuthorityFactory.js +1 -1
- package/dist/authority/AuthorityType.js +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
- package/dist/authority/OpenIdConfigResponse.d.ts +1 -1
- package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.js +1 -2
- package/dist/authority/OpenIdConfigResponse.js.map +1 -1
- package/dist/authority/ProtocolMode.js +1 -1
- package/dist/authority/RegionDiscovery.js +1 -1
- package/dist/cache/CacheManager.d.ts +23 -9
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +206 -76
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +3 -2
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.js +15 -9
- package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts +2 -2
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.js +8 -8
- package/dist/cache/entities/AccountEntity.js.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.js +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.js +1 -2
- package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
- package/dist/cache/entities/CacheRecord.js +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +7 -3
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.js +13 -6
- package/dist/cache/entities/CredentialEntity.js.map +1 -1
- package/dist/cache/entities/IdTokenEntity.js +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
- package/dist/cache/entities/ThrottlingEntity.js +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +5 -5
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.js +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +4 -1
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +2 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.js +58 -21
- package/dist/client/AuthorizationCodeClient.js.map +1 -1
- package/dist/client/BaseClient.js +1 -1
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.js +8 -2
- package/dist/client/ClientCredentialClient.js.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.js +15 -3
- package/dist/client/DeviceCodeClient.js.map +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.js +8 -2
- package/dist/client/OnBehalfOfClient.js.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.js +28 -11
- package/dist/client/RefreshTokenClient.js.map +1 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.js +17 -12
- package/dist/client/SilentFlowClient.js.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.js +8 -2
- package/dist/client/UsernamePasswordClient.js.map +1 -1
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.js +3 -2
- package/dist/config/ClientConfiguration.js.map +1 -1
- package/dist/crypto/ICrypto.d.ts +11 -1
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.js +19 -1
- package/dist/crypto/ICrypto.js.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +21 -4
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.js +37 -26
- package/dist/crypto/PopTokenGenerator.js.map +1 -1
- package/dist/error/AuthError.d.ts +5 -0
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.js +4 -1
- package/dist/error/AuthError.js.map +1 -1
- package/dist/error/ClientAuthError.d.ts +13 -4
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.js +18 -7
- package/dist/error/ClientAuthError.js.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts +29 -0
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.js +43 -3
- package/dist/error/ClientConfigurationError.js.map +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +24 -5
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.js +30 -9
- package/dist/error/InteractionRequiredAuthError.js.map +1 -1
- package/dist/error/ServerError.js +1 -1
- package/dist/index.cjs.js +641 -226
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.js +5 -3
- package/dist/logger/Logger.js.map +1 -1
- package/dist/network/INetworkModule.js +1 -1
- package/dist/network/NetworkManager.js +1 -1
- package/dist/network/RequestThumbprint.d.ts +7 -0
- package/dist/network/RequestThumbprint.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.d.ts +2 -1
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.js +11 -5
- package/dist/network/ThrottlingUtils.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthenticationHeaderParser.d.ts +20 -0
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -0
- package/dist/request/AuthenticationHeaderParser.js +64 -0
- package/dist/request/AuthenticationHeaderParser.js.map +1 -0
- package/dist/request/BaseAuthRequest.d.ts +7 -1
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +3 -0
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonEndSessionRequest.d.ts +4 -0
- package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +4 -0
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.js +10 -1
- package/dist/request/RequestParameterBuilder.js.map +1 -1
- package/dist/request/RequestValidator.js +1 -1
- package/dist/request/ScopeSet.js +1 -1
- package/dist/response/AuthenticationResult.d.ts +3 -1
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/ExternalTokenResponse.d.ts +15 -0
- package/dist/response/ExternalTokenResponse.d.ts.map +1 -0
- package/dist/response/ResponseHandler.d.ts +1 -1
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.js +21 -15
- package/dist/response/ResponseHandler.js.map +1 -1
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +6 -2
- package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
- package/dist/url/UrlString.d.ts +0 -6
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.js +3 -18
- package/dist/url/UrlString.js.map +1 -1
- package/dist/utils/Constants.d.ts +7 -3
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.js +6 -2
- package/dist/utils/Constants.js.map +1 -1
- package/dist/utils/ProtocolUtils.js +1 -1
- package/dist/utils/StringUtils.d.ts.map +1 -1
- package/dist/utils/StringUtils.js +12 -11
- package/dist/utils/StringUtils.js.map +1 -1
- package/dist/utils/TimeUtils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorityMetadataEntity.js","sources":["../../../src/cache/entities/AuthorityMetadataEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CloudDiscoveryMetadata } from \"../../authority/CloudDiscoveryMetadata\";\nimport { OpenIdConfigResponse } from \"../../authority/OpenIdConfigResponse\";\nimport { AUTHORITY_METADATA_CONSTANTS } from \"../../utils/Constants\";\nimport { TimeUtils } from \"../../utils/TimeUtils\";\n\nexport class AuthorityMetadataEntity {\n aliases: Array<string>;\n preferred_cache: string;\n preferred_network: string;\n canonical_authority: string;\n authorization_endpoint: string;\n token_endpoint: string;\n end_session_endpoint
|
|
1
|
+
{"version":3,"file":"AuthorityMetadataEntity.js","sources":["../../../src/cache/entities/AuthorityMetadataEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CloudDiscoveryMetadata } from \"../../authority/CloudDiscoveryMetadata\";\nimport { OpenIdConfigResponse } from \"../../authority/OpenIdConfigResponse\";\nimport { AUTHORITY_METADATA_CONSTANTS } from \"../../utils/Constants\";\nimport { TimeUtils } from \"../../utils/TimeUtils\";\n\nexport class AuthorityMetadataEntity {\n aliases: Array<string>;\n preferred_cache: string;\n preferred_network: string;\n canonical_authority: string;\n authorization_endpoint: string;\n token_endpoint: string;\n end_session_endpoint?: string;\n issuer: string;\n aliasesFromNetwork: boolean;\n endpointsFromNetwork: boolean;\n expiresAt: number;\n\n constructor() {\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\n }\n\n /**\n * Update the entity with new aliases, preferred_cache and preferred_network values\n * @param metadata \n * @param fromNetwork \n */\n updateCloudDiscoveryMetadata(metadata: CloudDiscoveryMetadata, fromNetwork: boolean): void {\n this.aliases = metadata.aliases;\n this.preferred_cache = metadata.preferred_cache;\n this.preferred_network = metadata.preferred_network;\n this.aliasesFromNetwork = fromNetwork;\n }\n\n /**\n * Update the entity with new endpoints\n * @param metadata \n * @param fromNetwork \n */\n updateEndpointMetadata(metadata: OpenIdConfigResponse, fromNetwork: boolean): void {\n this.authorization_endpoint = metadata.authorization_endpoint;\n this.token_endpoint = metadata.token_endpoint;\n this.end_session_endpoint = metadata.end_session_endpoint;\n this.issuer = metadata.issuer;\n this.endpointsFromNetwork = fromNetwork;\n }\n\n /**\n * Save the authority that was used to create this cache entry\n * @param authority \n */\n updateCanonicalAuthority(authority: string): void {\n this.canonical_authority = authority;\n }\n\n /**\n * Reset the exiresAt value\n */\n resetExpiresAt(): void {\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\n }\n\n /**\n * Returns whether or not the data needs to be refreshed\n */\n isExpired(): boolean {\n return this.expiresAt <= TimeUtils.nowSeconds();\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAuthorityMetadataEntity(key: string, entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) === 0 &&\n entity.hasOwnProperty(\"aliases\") &&\n entity.hasOwnProperty(\"preferred_cache\") &&\n entity.hasOwnProperty(\"preferred_network\") &&\n entity.hasOwnProperty(\"canonical_authority\") &&\n entity.hasOwnProperty(\"authorization_endpoint\") &&\n entity.hasOwnProperty(\"token_endpoint\") &&\n entity.hasOwnProperty(\"issuer\") &&\n entity.hasOwnProperty(\"aliasesFromNetwork\") &&\n entity.hasOwnProperty(\"endpointsFromNetwork\") &&\n entity.hasOwnProperty(\"expiresAt\")\n );\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;IAuBI;QACI,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,UAAU,EAAE,GAAG,4BAA4B,CAAC,oBAAoB,CAAC;KAC/F;;;;;;IAOD,8DAA4B,GAA5B,UAA6B,QAAgC,EAAE,WAAoB;QAC/E,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC;QAChD,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC;QACpD,IAAI,CAAC,kBAAkB,GAAG,WAAW,CAAC;KACzC;;;;;;IAOD,wDAAsB,GAAtB,UAAuB,QAA8B,EAAE,WAAoB;QACvE,IAAI,CAAC,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,CAAC;QAC9D,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;QAC9C,IAAI,CAAC,oBAAoB,GAAG,QAAQ,CAAC,oBAAoB,CAAC;QAC1D,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;KAC3C;;;;;IAMD,0DAAwB,GAAxB,UAAyB,SAAiB;QACtC,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;KACxC;;;;IAKD,gDAAc,GAAd;QACI,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,UAAU,EAAE,GAAG,4BAA4B,CAAC,oBAAoB,CAAC;KAC/F;;;;IAKD,2CAAS,GAAT;QACI,OAAO,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;KACnD;;;;;IAMM,iDAAyB,GAAhC,UAAiC,GAAW,EAAE,MAAc;QAExD,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,KAAK,CAAC;SAChB;QAED,QACI,GAAG,CAAC,OAAO,CAAC,4BAA4B,CAAC,SAAS,CAAC,KAAK,CAAC;YACzD,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC;YAChC,MAAM,CAAC,cAAc,CAAC,iBAAiB,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC;YAC1C,MAAM,CAAC,cAAc,CAAC,qBAAqB,CAAC;YAC5C,MAAM,CAAC,cAAc,CAAC,wBAAwB,CAAC;YAC/C,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;YACvC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC;YAC3C,MAAM,CAAC,cAAc,CAAC,sBAAsB,CAAC;YAC7C,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,EACpC;KACL;IACL,8BAAC;AAAD,CAAC;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CredentialType } from "../../utils/Constants";
|
|
1
|
+
import { CredentialType, AuthenticationScheme } from "../../utils/Constants";
|
|
2
2
|
/**
|
|
3
3
|
* Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc
|
|
4
4
|
*
|
|
5
5
|
* Key:Value Schema:
|
|
6
6
|
*
|
|
7
|
-
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target
|
|
7
|
+
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<scheme>
|
|
8
8
|
*
|
|
9
9
|
* Value Schema:
|
|
10
10
|
* {
|
|
@@ -17,6 +17,7 @@ import { CredentialType } from "../../utils/Constants";
|
|
|
17
17
|
* realm: Full tenant or organizational identifier that the account belongs to
|
|
18
18
|
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
19
19
|
* oboAssertion: access token passed in as part of OBO request
|
|
20
|
+
* tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
|
|
20
21
|
* }
|
|
21
22
|
*/
|
|
22
23
|
export declare class CredentialEntity {
|
|
@@ -29,6 +30,8 @@ export declare class CredentialEntity {
|
|
|
29
30
|
realm?: string;
|
|
30
31
|
target?: string;
|
|
31
32
|
oboAssertion?: string;
|
|
33
|
+
tokenType?: AuthenticationScheme;
|
|
34
|
+
keyId?: string;
|
|
32
35
|
/**
|
|
33
36
|
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
34
37
|
*/
|
|
@@ -56,8 +59,9 @@ export declare class CredentialEntity {
|
|
|
56
59
|
static getCredentialType(key: string): string;
|
|
57
60
|
/**
|
|
58
61
|
* generates credential key
|
|
62
|
+
* <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
|
|
59
63
|
*/
|
|
60
|
-
static generateCredentialCacheKey(homeAccountId: string, environment: string, credentialType: CredentialType, clientId: string, realm?: string, target?: string, familyId?: string): string;
|
|
64
|
+
static generateCredentialCacheKey(homeAccountId: string, environment: string, credentialType: CredentialType, clientId: string, realm?: string, target?: string, familyId?: string, tokenType?: AuthenticationScheme): string;
|
|
61
65
|
/**
|
|
62
66
|
* generates Account Id for keys
|
|
63
67
|
* @param homeAccountId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/CredentialEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,cAAc,EAAwB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CredentialEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/CredentialEntity.ts"],"names":[],"mappings":"AAKA,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|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v5.2.0 2021-12-07 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { CredentialType, CacheType, Constants, Separators } from '../../utils/Constants.js';
|
|
3
|
+
import { CredentialType, CacheType, Constants, AuthenticationScheme, Separators } from '../../utils/Constants.js';
|
|
4
4
|
import { ClientAuthError } from '../../error/ClientAuthError.js';
|
|
5
5
|
|
|
6
6
|
/*
|
|
@@ -12,7 +12,7 @@ import { ClientAuthError } from '../../error/ClientAuthError.js';
|
|
|
12
12
|
*
|
|
13
13
|
* Key:Value Schema:
|
|
14
14
|
*
|
|
15
|
-
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target
|
|
15
|
+
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<scheme>
|
|
16
16
|
*
|
|
17
17
|
* Value Schema:
|
|
18
18
|
* {
|
|
@@ -25,6 +25,7 @@ import { ClientAuthError } from '../../error/ClientAuthError.js';
|
|
|
25
25
|
* realm: Full tenant or organizational identifier that the account belongs to
|
|
26
26
|
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
27
27
|
* oboAssertion: access token passed in as part of OBO request
|
|
28
|
+
* tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
|
|
28
29
|
* }
|
|
29
30
|
*/
|
|
30
31
|
var CredentialEntity = /** @class */ (function () {
|
|
@@ -52,7 +53,7 @@ var CredentialEntity = /** @class */ (function () {
|
|
|
52
53
|
* generates credential key
|
|
53
54
|
*/
|
|
54
55
|
CredentialEntity.prototype.generateCredentialKey = function () {
|
|
55
|
-
return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId);
|
|
56
|
+
return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId, this.tokenType);
|
|
56
57
|
};
|
|
57
58
|
/**
|
|
58
59
|
* returns the type of the cache (in this case credential)
|
|
@@ -62,6 +63,7 @@ var CredentialEntity = /** @class */ (function () {
|
|
|
62
63
|
case CredentialType.ID_TOKEN:
|
|
63
64
|
return CacheType.ID_TOKEN;
|
|
64
65
|
case CredentialType.ACCESS_TOKEN:
|
|
66
|
+
case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:
|
|
65
67
|
return CacheType.ACCESS_TOKEN;
|
|
66
68
|
case CredentialType.REFRESH_TOKEN:
|
|
67
69
|
return CacheType.REFRESH_TOKEN;
|
|
@@ -93,13 +95,18 @@ var CredentialEntity = /** @class */ (function () {
|
|
|
93
95
|
};
|
|
94
96
|
/**
|
|
95
97
|
* generates credential key
|
|
98
|
+
* <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
|
|
96
99
|
*/
|
|
97
|
-
CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId) {
|
|
100
|
+
CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId, tokenType) {
|
|
98
101
|
var credentialKey = [
|
|
99
102
|
this.generateAccountIdForCacheKey(homeAccountId, environment),
|
|
100
103
|
this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),
|
|
101
|
-
this.generateTargetForCacheKey(target)
|
|
104
|
+
this.generateTargetForCacheKey(target)
|
|
102
105
|
];
|
|
106
|
+
// PoP Tokens and SSH certs include scheme in cache key
|
|
107
|
+
if (tokenType && tokenType !== AuthenticationScheme.BEARER) {
|
|
108
|
+
credentialKey.push(tokenType.toLowerCase());
|
|
109
|
+
}
|
|
103
110
|
return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
104
111
|
};
|
|
105
112
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialEntity.js","sources":["../../../src/cache/entities/CredentialEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Separators, CredentialType, CacheType, Constants } from \"../../utils/Constants\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\n\n/**\n * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc\n *\n * Key:Value Schema:\n *\n * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target
|
|
1
|
+
{"version":3,"file":"CredentialEntity.js","sources":["../../../src/cache/entities/CredentialEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Separators, CredentialType, CacheType, Constants, AuthenticationScheme } from \"../../utils/Constants\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\n\n/**\n * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc\n *\n * Key:Value Schema:\n *\n * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<scheme>\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, usually only used for refresh tokens\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * oboAssertion: access token passed in as part of OBO request\n * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)\n * }\n */\nexport class CredentialEntity {\n homeAccountId: string;\n environment: string;\n credentialType: CredentialType;\n clientId: string;\n secret: string;\n familyId?: string;\n realm?: string;\n target?: string;\n oboAssertion?: string;\n tokenType?: AuthenticationScheme;\n keyId?: string;\n\n /**\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\n */\n generateAccountId(): string {\n return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);\n }\n\n /**\n * Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>\n */\n generateCredentialId(): string {\n return CredentialEntity.generateCredentialIdForCacheKey(\n this.credentialType,\n this.clientId,\n this.realm,\n this.familyId\n );\n }\n\n /**\n * Generate target key component as per schema: <target>\n */\n generateTarget(): string {\n return CredentialEntity.generateTargetForCacheKey(this.target);\n }\n\n /**\n * generates credential key\n */\n generateCredentialKey(): string {\n return CredentialEntity.generateCredentialCacheKey(\n this.homeAccountId,\n this.environment,\n this.credentialType,\n this.clientId,\n this.realm,\n this.target,\n this.familyId,\n this.tokenType\n );\n }\n\n /**\n * returns the type of the cache (in this case credential)\n */\n generateType(): number {\n switch (this.credentialType) {\n case CredentialType.ID_TOKEN:\n return CacheType.ID_TOKEN;\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\n return CacheType.ACCESS_TOKEN;\n case CredentialType.REFRESH_TOKEN:\n return CacheType.REFRESH_TOKEN;\n default: {\n throw ClientAuthError.createUnexpectedCredentialTypeError();\n }\n }\n }\n\n /**\n * helper function to return `CredentialType`\n * @param key\n */\n static getCredentialType(key: string): string {\n // First keyword search will match all \"AccessToken\" and \"AccessToken_With_AuthScheme\" credentials\n if (key.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) !== -1) {\n // Perform second search to differentiate between \"AccessToken\" and \"AccessToken_With_AuthScheme\" credential types\n if (key.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) !== -1) {\n return CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\n }\n return CredentialType.ACCESS_TOKEN;\n } else if (key.indexOf(CredentialType.ID_TOKEN.toLowerCase()) !== -1) {\n return CredentialType.ID_TOKEN;\n } else if (key.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) !== -1) {\n return CredentialType.REFRESH_TOKEN;\n }\n\n return Constants.NOT_DEFINED;\n }\n\n /**\n * generates credential key\n * <home_account_id*>-\\<environment>-<credential_type>-<client_id>-<realm\\*>-<target\\*>-<scheme\\*>\n */\n static generateCredentialCacheKey(\n homeAccountId: string,\n environment: string,\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n target?: string,\n familyId?: string,\n tokenType?: AuthenticationScheme\n ): string {\n const credentialKey = [\n this.generateAccountIdForCacheKey(homeAccountId, environment),\n this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),\n this.generateTargetForCacheKey(target)\n ];\n\n // PoP Tokens and SSH certs include scheme in cache key\n if (tokenType && tokenType !== AuthenticationScheme.BEARER) {\n credentialKey.push(tokenType.toLowerCase());\n }\n\n return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * generates Account Id for keys\n * @param homeAccountId\n * @param environment\n */\n private static generateAccountIdForCacheKey(\n homeAccountId: string,\n environment: string\n ): string {\n const accountId: Array<string> = [homeAccountId, environment];\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generates Credential Id for keys\n * @param credentialType\n * @param realm\n * @param clientId\n * @param familyId\n */\n private static generateCredentialIdForCacheKey(\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n familyId?: string\n ): string {\n const clientOrFamilyId =\n credentialType === CredentialType.REFRESH_TOKEN\n ? familyId || clientId\n : clientId;\n const credentialId: Array<string> = [\n credentialType,\n clientOrFamilyId,\n realm || \"\",\n ];\n\n return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generate target key component as per schema: <target>\n */\n private static generateTargetForCacheKey(scopes?: string): string {\n return (scopes || \"\").toLowerCase();\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;IAqBA;KAuKC;;;;IAvJG,4CAAiB,GAAjB;QACI,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;KAC9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AM,gBAAgB,GAClB,cAAc,KAAK,cAAc,CAAC,aAAa;cACzC,QAAQ,IAAI,QAAQ;cACpB,QAAQ,CAAC;QACnB,IAAM,YAAY,GAAkB;YAChC,cAAc;YACd,gBAAgB;YAChB,KAAK,IAAI,EAAE;SACd,CAAC;QAEF,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KAC1E;;;;IAKc,0CAAyB,GAAxC,UAAyC,MAAe;QACpD,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;KACvC;IACL,uBAAC;AAAD,CAAC;;;;"}
|
|
@@ -116,7 +116,7 @@ export interface ICacheManager {
|
|
|
116
116
|
* saves a cache record
|
|
117
117
|
* @param cacheRecord
|
|
118
118
|
*/
|
|
119
|
-
saveCacheRecord(cacheRecord: CacheRecord): void
|
|
119
|
+
saveCacheRecord(cacheRecord: CacheRecord): Promise<void>;
|
|
120
120
|
/**
|
|
121
121
|
* retrieve accounts matching all provided filters; if no filter is set, get all accounts
|
|
122
122
|
* @param homeAccountId
|
|
@@ -137,21 +137,21 @@ export interface ICacheManager {
|
|
|
137
137
|
/**
|
|
138
138
|
* Removes all accounts and related tokens from cache.
|
|
139
139
|
*/
|
|
140
|
-
removeAllAccounts(): boolean
|
|
140
|
+
removeAllAccounts(): Promise<boolean>;
|
|
141
141
|
/**
|
|
142
142
|
* returns a boolean if the given account is removed
|
|
143
143
|
* @param account
|
|
144
144
|
*/
|
|
145
|
-
removeAccount(accountKey: string): boolean
|
|
145
|
+
removeAccount(accountKey: string): Promise<boolean>;
|
|
146
146
|
/**
|
|
147
147
|
* returns a boolean if the given account is removed
|
|
148
148
|
* @param account
|
|
149
149
|
*/
|
|
150
|
-
removeAccountContext(account: AccountEntity): boolean
|
|
150
|
+
removeAccountContext(account: AccountEntity): Promise<boolean>;
|
|
151
151
|
/**
|
|
152
152
|
* returns a boolean if the given credential is removed
|
|
153
153
|
* @param credential
|
|
154
154
|
*/
|
|
155
|
-
removeCredential(credential: CredentialEntity): boolean
|
|
155
|
+
removeCredential(credential: CredentialEntity): Promise<boolean>;
|
|
156
156
|
}
|
|
157
157
|
//# sourceMappingURL=ICacheManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ICacheManager.d.ts","sourceRoot":"","sources":["../../../src/cache/interface/ICacheManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EACH,YAAY,EACZ,eAAe,EACf,aAAa,EACb,gBAAgB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,MAAM,WAAW,aAAa;IAE1B;;;OAGG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IAErD;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAEzC;;;OAGG;IACH,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IAE/D;;;OAGG;IACH,oBAAoB,CAAC,OAA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,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAExF;;OAEG;IACH,cAAc,IAAI,WAAW,EAAE,CAAC;IAEhC;;;OAGG;IACH,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;;;OAKG;IACH,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAAC;IAE3D;;;;;;;;OAQG;IACH,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,GAAG,eAAe,CAAC;IAEpE;;OAEG;IACH,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtC;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpD;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE/D;;;OAGG;IACH,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACpE"}
|
|
@@ -6,6 +6,7 @@ import { AppMetadataEntity } from "../entities/AppMetadataEntity";
|
|
|
6
6
|
import { ServerTelemetryEntity } from "../entities/ServerTelemetryEntity";
|
|
7
7
|
import { ThrottlingEntity } from "../entities/ThrottlingEntity";
|
|
8
8
|
import { AuthorityMetadataEntity } from "../entities/AuthorityMetadataEntity";
|
|
9
|
+
import { AuthenticationScheme } from "../../utils/Constants";
|
|
9
10
|
export declare type AccountCache = Record<string, AccountEntity>;
|
|
10
11
|
export declare type IdTokenCache = Record<string, IdTokenEntity>;
|
|
11
12
|
export declare type AccessTokenCache = Record<string, AccessTokenEntity>;
|
|
@@ -33,7 +34,7 @@ export declare type AccountFilter = {
|
|
|
33
34
|
realm?: string;
|
|
34
35
|
};
|
|
35
36
|
/**
|
|
36
|
-
* Credential: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>
|
|
37
|
+
* Credential: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<scheme*>
|
|
37
38
|
*/
|
|
38
39
|
export declare type CredentialFilter = {
|
|
39
40
|
homeAccountId?: string;
|
|
@@ -44,6 +45,8 @@ export declare type CredentialFilter = {
|
|
|
44
45
|
realm?: string;
|
|
45
46
|
target?: string;
|
|
46
47
|
oboAssertion?: string;
|
|
48
|
+
tokenType?: AuthenticationScheme;
|
|
49
|
+
keyId?: string;
|
|
47
50
|
};
|
|
48
51
|
/**
|
|
49
52
|
* AppMetadata: appmetadata-<environment>-<client_id>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheTypes.d.ts","sourceRoot":"","sources":["../../../src/cache/utils/CacheTypes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"CacheTypes.d.ts","sourceRoot":"","sources":["../../../src/cache/utils/CacheTypes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,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ACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,oBAAY,iBAAiB,GAAG;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { AuthorizationCodePayload } from "../response/AuthorizationCodePayload";
|
|
|
9
9
|
* Oauth2.0 Authorization Code client
|
|
10
10
|
*/
|
|
11
11
|
export declare class AuthorizationCodeClient extends BaseClient {
|
|
12
|
+
protected includeRedirectUri: boolean;
|
|
12
13
|
constructor(configuration: ClientConfiguration);
|
|
13
14
|
/**
|
|
14
15
|
* Creates the URL of the authorization request letting the user input credentials and consent to the
|
|
@@ -34,7 +35,7 @@ export declare class AuthorizationCodeClient extends BaseClient {
|
|
|
34
35
|
*/
|
|
35
36
|
handleFragmentResponse(hashFragment: string, cachedState: string): AuthorizationCodePayload;
|
|
36
37
|
/**
|
|
37
|
-
*
|
|
38
|
+
* Used to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
|
38
39
|
* Default behaviour is to redirect the user to `window.location.href`.
|
|
39
40
|
* @param authorityUri
|
|
40
41
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationCodeClient.d.ts","sourceRoot":"","sources":["../../src/client/AuthorizationCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAA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G;IACH,OAAO,CAAC,4BAA4B;IAsGpC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IA0BlC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;CAO5B"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v5.2.0 2021-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign, __spreadArrays } from '../_virtual/_tslib.js';
|
|
4
4
|
import { BaseClient } from './BaseClient.js';
|
|
5
5
|
import { RequestParameterBuilder } from '../request/RequestParameterBuilder.js';
|
|
6
|
-
import { PromptValue, Separators,
|
|
6
|
+
import { PromptValue, Separators, AADServerParamKeys, AuthenticationScheme, GrantType } from '../utils/Constants.js';
|
|
7
7
|
import { ResponseHandler } from '../response/ResponseHandler.js';
|
|
8
8
|
import { StringUtils } from '../utils/StringUtils.js';
|
|
9
9
|
import { ClientAuthError } from '../error/ClientAuthError.js';
|
|
10
10
|
import { UrlString } from '../url/UrlString.js';
|
|
11
|
-
import { AccountEntity } from '../cache/entities/AccountEntity.js';
|
|
12
|
-
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
13
11
|
import { PopTokenGenerator } from '../crypto/PopTokenGenerator.js';
|
|
14
12
|
import { TimeUtils } from '../utils/TimeUtils.js';
|
|
15
13
|
import { buildClientInfoFromHomeAccountId, buildClientInfo } from '../account/ClientInfo.js';
|
|
16
14
|
import { CcsCredentialType } from '../account/CcsCredential.js';
|
|
15
|
+
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
16
|
+
import { RequestValidator } from '../request/RequestValidator.js';
|
|
17
17
|
|
|
18
18
|
/*
|
|
19
19
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -25,7 +25,10 @@ import { CcsCredentialType } from '../account/CcsCredential.js';
|
|
|
25
25
|
var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
26
26
|
__extends(AuthorizationCodeClient, _super);
|
|
27
27
|
function AuthorizationCodeClient(configuration) {
|
|
28
|
-
|
|
28
|
+
var _this = _super.call(this, configuration) || this;
|
|
29
|
+
// Flag to indicate if client is for hybrid spa auth code redemption
|
|
30
|
+
_this.includeRedirectUri = true;
|
|
31
|
+
return _this;
|
|
29
32
|
}
|
|
30
33
|
/**
|
|
31
34
|
* Creates the URL of the authorization request letting the user input credentials and consent to the
|
|
@@ -97,7 +100,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
97
100
|
code: serverParams.code });
|
|
98
101
|
};
|
|
99
102
|
/**
|
|
100
|
-
*
|
|
103
|
+
* Used to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
|
101
104
|
* Default behaviour is to redirect the user to `window.location.href`.
|
|
102
105
|
* @param authorityUri
|
|
103
106
|
*/
|
|
@@ -106,14 +109,6 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
106
109
|
if (!logoutRequest) {
|
|
107
110
|
throw ClientConfigurationError.createEmptyLogoutRequestError();
|
|
108
111
|
}
|
|
109
|
-
if (logoutRequest.account) {
|
|
110
|
-
// Clear given account.
|
|
111
|
-
this.cacheManager.removeAccount(AccountEntity.generateAccountCacheKey(logoutRequest.account));
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
// Clear all accounts and tokens
|
|
115
|
-
this.cacheManager.clear();
|
|
116
|
-
}
|
|
117
112
|
var queryString = this.createLogoutUrlQueryString(logoutRequest);
|
|
118
113
|
// Construct logout URI.
|
|
119
114
|
return UrlString.appendQueryString(this.authority.endSessionEndpoint, queryString);
|
|
@@ -132,7 +127,13 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
132
127
|
thumbprint = {
|
|
133
128
|
clientId: this.config.authOptions.clientId,
|
|
134
129
|
authority: authority.canonicalAuthority,
|
|
135
|
-
scopes: request.scopes
|
|
130
|
+
scopes: request.scopes,
|
|
131
|
+
authenticationScheme: request.authenticationScheme,
|
|
132
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
133
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
134
|
+
shrClaims: request.shrClaims,
|
|
135
|
+
sshJwk: request.sshJwk,
|
|
136
|
+
sshKid: request.sshKid
|
|
136
137
|
};
|
|
137
138
|
return [4 /*yield*/, this.createTokenRequestBody(request)];
|
|
138
139
|
case 1:
|
|
@@ -176,13 +177,24 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
176
177
|
AuthorizationCodeClient.prototype.createTokenRequestBody = function (request) {
|
|
177
178
|
return __awaiter(this, void 0, void 0, function () {
|
|
178
179
|
var parameterBuilder, clientAssertion, popTokenGenerator, cnfString, correlationId, ccsCred, clientInfo, clientInfo;
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
var _a;
|
|
181
|
+
return __generator(this, function (_b) {
|
|
182
|
+
switch (_b.label) {
|
|
181
183
|
case 0:
|
|
182
184
|
parameterBuilder = new RequestParameterBuilder();
|
|
183
185
|
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
/*
|
|
187
|
+
* For hybrid spa flow, there will be a code but no verifier
|
|
188
|
+
* In this scenario, don't include redirect uri as auth code will not be bound to redirect URI
|
|
189
|
+
*/
|
|
190
|
+
if (!this.includeRedirectUri) {
|
|
191
|
+
// Just validate
|
|
192
|
+
RequestValidator.validateRedirectUri(request.redirectUri);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
// Validate and include redirect uri
|
|
196
|
+
parameterBuilder.addRedirectUri(request.redirectUri);
|
|
197
|
+
}
|
|
186
198
|
// Add scope array, parameter builder will add default scopes and dedupe
|
|
187
199
|
parameterBuilder.addScopes(request.scopes);
|
|
188
200
|
// add code: user set, not validated
|
|
@@ -211,10 +223,20 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
211
223
|
popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);
|
|
212
224
|
return [4 /*yield*/, popTokenGenerator.generateCnf(request)];
|
|
213
225
|
case 1:
|
|
214
|
-
cnfString =
|
|
226
|
+
cnfString = _b.sent();
|
|
215
227
|
parameterBuilder.addPopToken(cnfString);
|
|
216
|
-
|
|
228
|
+
return [3 /*break*/, 3];
|
|
217
229
|
case 2:
|
|
230
|
+
if (request.authenticationScheme === AuthenticationScheme.SSH) {
|
|
231
|
+
if (request.sshJwk) {
|
|
232
|
+
parameterBuilder.addSshJwk(request.sshJwk);
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
throw ClientConfigurationError.createMissingSshJwkError();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
_b.label = 3;
|
|
239
|
+
case 3:
|
|
218
240
|
correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();
|
|
219
241
|
parameterBuilder.addCorrelationId(correlationId);
|
|
220
242
|
if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {
|
|
@@ -253,6 +275,15 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
253
275
|
break;
|
|
254
276
|
}
|
|
255
277
|
}
|
|
278
|
+
if (request.tokenBodyParameters) {
|
|
279
|
+
parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);
|
|
280
|
+
}
|
|
281
|
+
// Add hybrid spa parameters if not already provided
|
|
282
|
+
if (request.enableSpaAuthorizationCode && (!request.tokenBodyParameters || !request.tokenBodyParameters[AADServerParamKeys.RETURN_SPA_CODE])) {
|
|
283
|
+
parameterBuilder.addExtraQueryParameters((_a = {},
|
|
284
|
+
_a[AADServerParamKeys.RETURN_SPA_CODE] = "1",
|
|
285
|
+
_a));
|
|
286
|
+
}
|
|
256
287
|
return [2 /*return*/, parameterBuilder.createQueryString()];
|
|
257
288
|
}
|
|
258
289
|
});
|
|
@@ -368,6 +399,12 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
368
399
|
if (request.idTokenHint) {
|
|
369
400
|
parameterBuilder.addIdTokenHint(request.idTokenHint);
|
|
370
401
|
}
|
|
402
|
+
if (request.state) {
|
|
403
|
+
parameterBuilder.addState(request.state);
|
|
404
|
+
}
|
|
405
|
+
if (request.extraQueryParameters) {
|
|
406
|
+
parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
|
|
407
|
+
}
|
|
371
408
|
return parameterBuilder.createQueryString();
|
|
372
409
|
};
|
|
373
410
|
/**
|