@azure/msal-common 15.8.0 → 15.8.1
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/dist/account/AccountInfo.mjs +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/authority/Authority.mjs +1 -1
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityMetadata.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/RegionDiscovery.mjs +1 -1
- package/dist/cache/CacheManager.mjs +1 -1
- package/dist/cache/entities/AccountEntity.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +5 -4
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.mjs +1 -1
- package/dist/client/RefreshTokenClient.mjs +1 -1
- package/dist/client/SilentFlowClient.mjs +1 -1
- package/dist/config/ClientConfiguration.mjs +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +1 -1
- package/dist/error/AuthError.mjs +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.mjs +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.mjs +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ClientConfigurationError.d.ts +0 -5
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +2 -7
- package/dist/error/ClientConfigurationError.mjs.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts +0 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +2 -3
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.mjs +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/NetworkError.mjs +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/index-browser.mjs +1 -1
- package/dist/index-node.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/RequestThumbprint.mjs +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
- package/dist/url/UrlString.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/Constants.mjs +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -1
- package/dist/utils/ProtocolUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/UrlUtils.mjs +1 -1
- package/lib/index-browser.cjs +2 -2
- package/lib/{index-node-2PsHlOld.js → index-node-BCM1mkg5.js} +6 -76
- package/lib/index-node-BCM1mkg5.js.map +1 -0
- package/lib/index-node.cjs +2 -2
- package/lib/index.cjs +2 -2
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationError.d.ts +0 -5
- package/lib/types/error/ClientConfigurationError.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts +0 -1
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/package.json +1 -1
- package/src/client/AuthorizationCodeClient.ts +5 -2
- package/src/error/ClientConfigurationError.ts +0 -8
- package/src/error/ClientConfigurationErrorCodes.ts +0 -1
- package/src/packageMetadata.ts +1 -1
- package/dist/request/RequestValidator.d.ts +0 -28
- package/dist/request/RequestValidator.d.ts.map +0 -1
- package/dist/request/RequestValidator.mjs +0 -73
- package/dist/request/RequestValidator.mjs.map +0 -1
- package/lib/index-node-2PsHlOld.js.map +0 -1
- package/lib/types/request/RequestValidator.d.ts +0 -28
- package/lib/types/request/RequestValidator.d.ts.map +0 -1
- package/src/request/RequestValidator.ts +0 -90
package/package.json
CHANGED
|
@@ -42,7 +42,6 @@ import {
|
|
|
42
42
|
createClientConfigurationError,
|
|
43
43
|
ClientConfigurationErrorCodes,
|
|
44
44
|
} from "../error/ClientConfigurationError.js";
|
|
45
|
-
import { RequestValidator } from "../request/RequestValidator.js";
|
|
46
45
|
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
|
|
47
46
|
import { PerformanceEvents } from "../telemetry/performance/PerformanceEvent.js";
|
|
48
47
|
import { invokeAsync } from "../utils/FunctionWrappers.js";
|
|
@@ -250,7 +249,11 @@ export class AuthorizationCodeClient extends BaseClient {
|
|
|
250
249
|
*/
|
|
251
250
|
if (!this.includeRedirectUri) {
|
|
252
251
|
// Just validate
|
|
253
|
-
|
|
252
|
+
if (!request.redirectUri) {
|
|
253
|
+
throw createClientConfigurationError(
|
|
254
|
+
ClientConfigurationErrorCodes.redirectUriEmpty
|
|
255
|
+
);
|
|
256
|
+
}
|
|
254
257
|
} else {
|
|
255
258
|
// Validate and include redirect uri
|
|
256
259
|
RequestParameterBuilder.addRedirectUri(
|
|
@@ -19,8 +19,6 @@ export const ClientConfigurationErrorMessages = {
|
|
|
19
19
|
[ClientConfigurationErrorCodes.urlEmptyError]: "URL was empty or null.",
|
|
20
20
|
[ClientConfigurationErrorCodes.emptyInputScopesError]:
|
|
21
21
|
"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",
|
|
22
|
-
[ClientConfigurationErrorCodes.invalidPromptValue]:
|
|
23
|
-
"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",
|
|
24
22
|
[ClientConfigurationErrorCodes.invalidClaims]:
|
|
25
23
|
"Given claims parameter must be a stringified JSON object.",
|
|
26
24
|
[ClientConfigurationErrorCodes.tokenRequestEmpty]:
|
|
@@ -94,12 +92,6 @@ export const ClientConfigurationErrorMessage = {
|
|
|
94
92
|
ClientConfigurationErrorCodes.emptyInputScopesError
|
|
95
93
|
],
|
|
96
94
|
},
|
|
97
|
-
invalidPrompt: {
|
|
98
|
-
code: ClientConfigurationErrorCodes.invalidPromptValue,
|
|
99
|
-
desc: ClientConfigurationErrorMessages[
|
|
100
|
-
ClientConfigurationErrorCodes.invalidPromptValue
|
|
101
|
-
],
|
|
102
|
-
},
|
|
103
95
|
invalidClaimsRequest: {
|
|
104
96
|
code: ClientConfigurationErrorCodes.invalidClaims,
|
|
105
97
|
desc: ClientConfigurationErrorMessages[
|
|
@@ -9,7 +9,6 @@ export const authorityUriInsecure = "authority_uri_insecure";
|
|
|
9
9
|
export const urlParseError = "url_parse_error";
|
|
10
10
|
export const urlEmptyError = "empty_url_error";
|
|
11
11
|
export const emptyInputScopesError = "empty_input_scopes_error";
|
|
12
|
-
export const invalidPromptValue = "invalid_prompt_value";
|
|
13
12
|
export const invalidClaims = "invalid_claims";
|
|
14
13
|
export const tokenRequestEmpty = "token_request_empty";
|
|
15
14
|
export const logoutRequestEmpty = "logout_request_empty";
|
package/src/packageMetadata.ts
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validates server consumable params from the "request" objects
|
|
3
|
-
*/
|
|
4
|
-
export declare class RequestValidator {
|
|
5
|
-
/**
|
|
6
|
-
* Utility to check if the `redirectUri` in the request is a non-null value
|
|
7
|
-
* @param redirectUri
|
|
8
|
-
*/
|
|
9
|
-
static validateRedirectUri(redirectUri: string): void;
|
|
10
|
-
/**
|
|
11
|
-
* Utility to validate prompt sent by the user in the request
|
|
12
|
-
* @param prompt
|
|
13
|
-
*/
|
|
14
|
-
static validatePrompt(prompt: string): void;
|
|
15
|
-
static validateClaims(claims: string): void;
|
|
16
|
-
/**
|
|
17
|
-
* Utility to validate code_challenge and code_challenge_method
|
|
18
|
-
* @param codeChallenge
|
|
19
|
-
* @param codeChallengeMethod
|
|
20
|
-
*/
|
|
21
|
-
static validateCodeChallengeParams(codeChallenge: string, codeChallengeMethod: string): void;
|
|
22
|
-
/**
|
|
23
|
-
* Utility to validate code_challenge_method
|
|
24
|
-
* @param codeChallengeMethod
|
|
25
|
-
*/
|
|
26
|
-
static validateCodeChallengeMethod(codeChallengeMethod: string): void;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=RequestValidator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestValidator.d.ts","sourceRoot":"","sources":["../../src/request/RequestValidator.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,qBAAa,gBAAgB;IACzB;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAQrD;;;OAGG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAc3C,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAU3C;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAC9B,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,MAAM,GAC5B,IAAI;IAUP;;;OAGG;IACH,MAAM,CAAC,2BAA2B,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI;CAYxE"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2
|
-
'use strict';
|
|
3
|
-
import { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';
|
|
4
|
-
import { CodeChallengeMethodValues, PromptValue } from '../utils/Constants.mjs';
|
|
5
|
-
import { redirectUriEmpty, invalidPromptValue, invalidClaims, pkceParamsMissing, invalidCodeChallengeMethod } from '../error/ClientConfigurationErrorCodes.mjs';
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
-
* Licensed under the MIT License.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Validates server consumable params from the "request" objects
|
|
13
|
-
*/
|
|
14
|
-
class RequestValidator {
|
|
15
|
-
/**
|
|
16
|
-
* Utility to check if the `redirectUri` in the request is a non-null value
|
|
17
|
-
* @param redirectUri
|
|
18
|
-
*/
|
|
19
|
-
static validateRedirectUri(redirectUri) {
|
|
20
|
-
if (!redirectUri) {
|
|
21
|
-
throw createClientConfigurationError(redirectUriEmpty);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Utility to validate prompt sent by the user in the request
|
|
26
|
-
* @param prompt
|
|
27
|
-
*/
|
|
28
|
-
static validatePrompt(prompt) {
|
|
29
|
-
const promptValues = [];
|
|
30
|
-
for (const value in PromptValue) {
|
|
31
|
-
promptValues.push(PromptValue[value]);
|
|
32
|
-
}
|
|
33
|
-
if (promptValues.indexOf(prompt) < 0) {
|
|
34
|
-
throw createClientConfigurationError(invalidPromptValue);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
static validateClaims(claims) {
|
|
38
|
-
try {
|
|
39
|
-
JSON.parse(claims);
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
throw createClientConfigurationError(invalidClaims);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Utility to validate code_challenge and code_challenge_method
|
|
47
|
-
* @param codeChallenge
|
|
48
|
-
* @param codeChallengeMethod
|
|
49
|
-
*/
|
|
50
|
-
static validateCodeChallengeParams(codeChallenge, codeChallengeMethod) {
|
|
51
|
-
if (!codeChallenge || !codeChallengeMethod) {
|
|
52
|
-
throw createClientConfigurationError(pkceParamsMissing);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
this.validateCodeChallengeMethod(codeChallengeMethod);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Utility to validate code_challenge_method
|
|
60
|
-
* @param codeChallengeMethod
|
|
61
|
-
*/
|
|
62
|
-
static validateCodeChallengeMethod(codeChallengeMethod) {
|
|
63
|
-
if ([
|
|
64
|
-
CodeChallengeMethodValues.PLAIN,
|
|
65
|
-
CodeChallengeMethodValues.S256,
|
|
66
|
-
].indexOf(codeChallengeMethod) < 0) {
|
|
67
|
-
throw createClientConfigurationError(invalidCodeChallengeMethod);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export { RequestValidator };
|
|
73
|
-
//# sourceMappingURL=RequestValidator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestValidator.mjs","sources":["../../src/request/RequestValidator.ts"],"sourcesContent":[null],"names":["ClientConfigurationErrorCodes.redirectUriEmpty","ClientConfigurationErrorCodes.invalidPromptValue","ClientConfigurationErrorCodes.invalidClaims","ClientConfigurationErrorCodes.pkceParamsMissing","ClientConfigurationErrorCodes.invalidCodeChallengeMethod"],"mappings":";;;;;;AAAA;;;AAGG;AAQH;;AAEG;MACU,gBAAgB,CAAA;AACzB;;;AAGG;IACH,OAAO,mBAAmB,CAAC,WAAmB,EAAA;QAC1C,IAAI,CAAC,WAAW,EAAE;AACd,YAAA,MAAM,8BAA8B,CAChCA,gBAA8C,CACjD,CAAC;AACL,SAAA;KACJ;AAED;;;AAGG;IACH,OAAO,cAAc,CAAC,MAAc,EAAA;QAChC,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,QAAA,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE;YAC7B,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;AACzC,SAAA;QAED,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;AAClC,YAAA,MAAM,8BAA8B,CAChCC,kBAAgD,CACnD,CAAC;AACL,SAAA;KACJ;IAED,OAAO,cAAc,CAAC,MAAc,EAAA;QAChC,IAAI;AACA,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACtB,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,8BAA8B,CAChCC,aAA2C,CAC9C,CAAC;AACL,SAAA;KACJ;AAED;;;;AAIG;AACH,IAAA,OAAO,2BAA2B,CAC9B,aAAqB,EACrB,mBAA2B,EAAA;AAE3B,QAAA,IAAI,CAAC,aAAa,IAAI,CAAC,mBAAmB,EAAE;AACxC,YAAA,MAAM,8BAA8B,CAChCC,iBAA+C,CAClD,CAAC;AACL,SAAA;AAAM,aAAA;AACH,YAAA,IAAI,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;AACzD,SAAA;KACJ;AAED;;;AAGG;IACH,OAAO,2BAA2B,CAAC,mBAA2B,EAAA;QAC1D,IACI;AACI,YAAA,yBAAyB,CAAC,KAAK;AAC/B,YAAA,yBAAyB,CAAC,IAAI;AACjC,SAAA,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,EACpC;AACE,YAAA,MAAM,8BAA8B,CAChCC,0BAAwD,CAC3D,CAAC;AACL,SAAA;KACJ;AACJ;;;;"}
|