@azure/msal-common 15.4.0 → 15.5.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 +2 -2
- 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.d.ts +5 -0
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +2 -1
- package/dist/config/ClientConfiguration.mjs.map +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.mjs +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +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.d.ts +2 -1
- package/dist/protocol/Authorize.d.ts.map +1 -1
- package/dist/protocol/Authorize.mjs +3 -3
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/RequestValidator.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.d.ts +1 -0
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +2 -1
- package/dist/utils/Constants.mjs.map +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.d.ts +2 -1
- package/dist/utils/UrlUtils.d.ts.map +1 -1
- package/dist/utils/UrlUtils.mjs +10 -3
- package/dist/utils/UrlUtils.mjs.map +1 -1
- package/lib/index-browser.cjs +2 -2
- package/lib/{index-node-C56U0Gkp.js → index-node-DHxgzN6_.js} +17 -8
- package/lib/index-node-DHxgzN6_.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/config/ClientConfiguration.d.ts +5 -0
- package/lib/types/config/ClientConfiguration.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/protocol/Authorize.d.ts +2 -1
- package/lib/types/protocol/Authorize.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +1 -0
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/lib/types/utils/UrlUtils.d.ts +2 -1
- package/lib/types/utils/UrlUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client/AuthorizationCodeClient.ts +5 -1
- package/src/config/ClientConfiguration.ts +6 -0
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +9 -3
- package/src/utils/Constants.ts +1 -0
- package/src/utils/UrlUtils.ts +15 -2
- package/lib/index-node-C56U0Gkp.js.map +0 -1
|
@@ -5,6 +5,7 @@ import { Logger } from "../logger/Logger.js";
|
|
|
5
5
|
import { Authority } from "../authority/Authority.js";
|
|
6
6
|
import { AuthorizationCodePayload } from "../response/AuthorizationCodePayload.js";
|
|
7
7
|
import { AuthorizeResponse } from "../response/AuthorizeResponse.js";
|
|
8
|
+
import { StringDict } from "../utils/MsalTypes.js";
|
|
8
9
|
/**
|
|
9
10
|
* Returns map of parameters that are applicable to all calls to /authorize whether using PKCE or EAR
|
|
10
11
|
* @param config
|
|
@@ -20,7 +21,7 @@ export declare function getStandardAuthorizeRequestParameters(authOptions: AuthO
|
|
|
20
21
|
* @param requestParameters
|
|
21
22
|
* @returns
|
|
22
23
|
*/
|
|
23
|
-
export declare function getAuthorizeUrl(authority: Authority, requestParameters: Map<string, string
|
|
24
|
+
export declare function getAuthorizeUrl(authority: Authority, requestParameters: Map<string, string>, encodeParams?: boolean, extraQueryParameters?: StringDict | undefined): string;
|
|
24
25
|
/**
|
|
25
26
|
* Handles the hash fragment response from public client code request. Returns a code response used by
|
|
26
27
|
* the client to exchange for a token in acquireToken.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authorize.d.ts","sourceRoot":"","sources":["../../../src/protocol/Authorize.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAG/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Authorize.d.ts","sourceRoot":"","sources":["../../../src/protocol/Authorize.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAG/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAUrE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;;;;;GAOG;AACH,wBAAgB,qCAAqC,CACjD,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,6BAA6B,EACtC,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,kBAAkB,GACvC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAsNrB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC3B,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,YAAY,CAAC,EAAE,OAAO,EACtB,oBAAoB,CAAC,EAAE,UAAU,GAAG,SAAS,GAC9C,MAAM,CAUR;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACvC,YAAY,EAAE,iBAAiB,EAC/B,WAAW,EAAE,MAAM,GACpB,wBAAwB,CAY1B;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CACzC,cAAc,EAAE,iBAAiB,EACjC,YAAY,EAAE,MAAM,GACrB,IAAI,CAuEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/utils/Constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDrB,CAAC;AAEF,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/utils/Constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDrB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;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4 +1,5 @@
|
|
|
1
1
|
import { AuthorizeResponse } from "../response/AuthorizeResponse.js";
|
|
2
|
+
import { StringDict } from "./MsalTypes.js";
|
|
2
3
|
/**
|
|
3
4
|
* Parses hash string from given string. Returns empty string if no hash symbol is found.
|
|
4
5
|
* @param hashString
|
|
@@ -11,5 +12,5 @@ export declare function getDeserializedResponse(responseString: string): Authori
|
|
|
11
12
|
/**
|
|
12
13
|
* Utility to create a URL from the params map
|
|
13
14
|
*/
|
|
14
|
-
export declare function mapToQueryString(parameters: Map<string, string
|
|
15
|
+
export declare function mapToQueryString(parameters: Map<string, string>, encodeExtraParams?: boolean, extraQueryParameters?: StringDict): string;
|
|
15
16
|
//# sourceMappingURL=UrlUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/UrlUtils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"UrlUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/UrlUtils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAKrE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAWtE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACnC,cAAc,EAAE,MAAM,GACvB,iBAAiB,GAAG,IAAI,CA4B1B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC5B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,iBAAiB,GAAE,OAAc,EACjC,oBAAoB,CAAC,EAAE,UAAU,GAClC,MAAM,CAgBR"}
|
package/package.json
CHANGED
|
@@ -507,6 +507,10 @@ export class AuthorizationCodeClient extends BaseClient {
|
|
|
507
507
|
RequestParameterBuilder.addInstanceAware(parameters);
|
|
508
508
|
}
|
|
509
509
|
|
|
510
|
-
return UrlUtils.mapToQueryString(
|
|
510
|
+
return UrlUtils.mapToQueryString(
|
|
511
|
+
parameters,
|
|
512
|
+
this.config.authOptions.encodeExtraQueryParams,
|
|
513
|
+
request.extraQueryParameters
|
|
514
|
+
);
|
|
511
515
|
}
|
|
512
516
|
}
|
|
@@ -83,6 +83,7 @@ export type CommonClientConfiguration = {
|
|
|
83
83
|
* - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.
|
|
84
84
|
* - instanceAware - A flag of whether the STS will send back additional parameters to specify where the tokens should be retrieved from.
|
|
85
85
|
* - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.
|
|
86
|
+
* - encodeExtraQueryParams - A flag to choose whether to encode the extra query parameters or not. Defaults to false.
|
|
86
87
|
* @internal
|
|
87
88
|
*/
|
|
88
89
|
export type AuthOptions = {
|
|
@@ -93,6 +94,10 @@ export type AuthOptions = {
|
|
|
93
94
|
azureCloudOptions?: AzureCloudOptions;
|
|
94
95
|
skipAuthorityMetadataCache?: boolean;
|
|
95
96
|
instanceAware?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated This flag is deprecated and will be removed in the next major version where all extra query params will be encoded by default.
|
|
99
|
+
*/
|
|
100
|
+
encodeExtraQueryParams?: boolean;
|
|
96
101
|
};
|
|
97
102
|
|
|
98
103
|
/**
|
|
@@ -276,6 +281,7 @@ function buildAuthOptions(authOptions: AuthOptions): Required<AuthOptions> {
|
|
|
276
281
|
azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,
|
|
277
282
|
skipAuthorityMetadataCache: false,
|
|
278
283
|
instanceAware: false,
|
|
284
|
+
encodeExtraQueryParams: false,
|
|
279
285
|
...authOptions,
|
|
280
286
|
};
|
|
281
287
|
}
|
package/src/packageMetadata.ts
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
isInteractionRequiredError,
|
|
27
27
|
} from "../error/InteractionRequiredAuthError.js";
|
|
28
28
|
import { ServerError } from "../error/ServerError.js";
|
|
29
|
+
import { StringDict } from "../utils/MsalTypes.js";
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Returns map of parameters that are applicable to all calls to /authorize whether using PKCE or EAR
|
|
@@ -264,10 +265,15 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
264
265
|
*/
|
|
265
266
|
export function getAuthorizeUrl(
|
|
266
267
|
authority: Authority,
|
|
267
|
-
requestParameters: Map<string, string
|
|
268
|
+
requestParameters: Map<string, string>,
|
|
269
|
+
encodeParams?: boolean,
|
|
270
|
+
extraQueryParameters?: StringDict | undefined
|
|
268
271
|
): string {
|
|
269
|
-
const queryString = mapToQueryString(
|
|
270
|
-
|
|
272
|
+
const queryString = mapToQueryString(
|
|
273
|
+
requestParameters,
|
|
274
|
+
encodeParams,
|
|
275
|
+
extraQueryParameters
|
|
276
|
+
);
|
|
271
277
|
return UrlString.appendQueryString(
|
|
272
278
|
authority.authorizationEndpoint,
|
|
273
279
|
queryString
|
package/src/utils/Constants.ts
CHANGED
package/src/utils/UrlUtils.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ClientAuthErrorCodes,
|
|
9
9
|
createClientAuthError,
|
|
10
10
|
} from "../error/ClientAuthError.js";
|
|
11
|
+
import { StringDict } from "./MsalTypes.js";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Parses hash string from given string. Returns empty string if no hash symbol is found.
|
|
@@ -64,11 +65,23 @@ export function getDeserializedResponse(
|
|
|
64
65
|
/**
|
|
65
66
|
* Utility to create a URL from the params map
|
|
66
67
|
*/
|
|
67
|
-
export function mapToQueryString(
|
|
68
|
+
export function mapToQueryString(
|
|
69
|
+
parameters: Map<string, string>,
|
|
70
|
+
encodeExtraParams: boolean = true,
|
|
71
|
+
extraQueryParameters?: StringDict
|
|
72
|
+
): string {
|
|
68
73
|
const queryParameterArray: Array<string> = new Array<string>();
|
|
69
74
|
|
|
70
75
|
parameters.forEach((value, key) => {
|
|
71
|
-
|
|
76
|
+
if (
|
|
77
|
+
!encodeExtraParams &&
|
|
78
|
+
extraQueryParameters &&
|
|
79
|
+
key in extraQueryParameters
|
|
80
|
+
) {
|
|
81
|
+
queryParameterArray.push(`${key}=${value}`);
|
|
82
|
+
} else {
|
|
83
|
+
queryParameterArray.push(`${key}=${encodeURIComponent(value)}`);
|
|
84
|
+
}
|
|
72
85
|
});
|
|
73
86
|
|
|
74
87
|
return queryParameterArray.join("&");
|