@azure/msal-browser 2.28.2 → 2.29.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/README.md +1 -1
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.d.ts +19 -10
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +67 -66
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.js +1 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +37 -10
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
- package/dist/cache/AsyncMemoryStorage.d.ts +7 -2
- package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +19 -15
- package/dist/cache/AsyncMemoryStorage.js.map +1 -1
- package/dist/cache/BrowserCacheManager.js +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/CryptoKeyStore.d.ts +18 -0
- package/dist/cache/CryptoKeyStore.d.ts.map +1 -0
- package/dist/cache/CryptoKeyStore.js +58 -0
- package/dist/cache/CryptoKeyStore.js.map +1 -0
- package/dist/cache/DatabaseStorage.d.ts.map +1 -1
- package/dist/cache/DatabaseStorage.js +10 -22
- package/dist/cache/DatabaseStorage.js.map +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.js +1 -1
- package/dist/config/Configuration.d.ts +16 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.js +5 -2
- package/dist/config/Configuration.js.map +1 -1
- package/dist/crypto/BrowserCrypto.d.ts +19 -59
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.js +65 -180
- package/dist/crypto/BrowserCrypto.js.map +1 -1
- package/dist/crypto/CryptoOps.d.ts +2 -13
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.js +10 -40
- package/dist/crypto/CryptoOps.js.map +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/ISubtleCrypto.d.ts +10 -0
- package/dist/crypto/ISubtleCrypto.d.ts.map +1 -0
- package/dist/crypto/ModernBrowserCrypto.d.ts +10 -0
- package/dist/crypto/ModernBrowserCrypto.d.ts.map +1 -0
- package/dist/crypto/ModernBrowserCrypto.js +55 -0
- package/dist/crypto/ModernBrowserCrypto.js.map +1 -0
- package/dist/crypto/MsBrowserCrypto.d.ts +10 -0
- package/dist/crypto/MsBrowserCrypto.d.ts.map +1 -0
- package/dist/crypto/MsBrowserCrypto.js +112 -0
- package/dist/crypto/MsBrowserCrypto.js.map +1 -0
- package/dist/crypto/MsrBrowserCrypto.d.ts +18 -0
- package/dist/crypto/MsrBrowserCrypto.d.ts.map +1 -0
- package/dist/crypto/MsrBrowserCrypto.js +59 -0
- package/dist/crypto/MsrBrowserCrypto.js.map +1 -0
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/SignedHttpRequest.js +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/error/BrowserAuthError.js +2 -2
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.d.ts +8 -0
- package/dist/error/BrowserConfigurationAuthError.d.ts.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +11 -1
- package/dist/error/BrowserConfigurationAuthError.js.map +1 -1
- package/dist/error/NativeAuthError.js +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/index.cjs.js +710 -410
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/interaction_client/BaseInteractionClient.js +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +3 -2
- package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.js +1 -1
- package/dist/interaction_client/RedirectClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +1 -1
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +8 -7
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +3 -2
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +1 -1
- package/dist/interaction_handler/InteractionHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/internals.js +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/XhrClient.js +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/PopupRequest.d.ts +1 -0
- package/dist/request/PopupRequest.d.ts.map +1 -1
- package/dist/request/RedirectRequest.d.ts +1 -0
- package/dist/request/RedirectRequest.d.ts.map +1 -1
- package/dist/request/SilentRequest.d.ts +9 -2
- package/dist/request/SilentRequest.d.ts.map +1 -1
- package/dist/request/SsoSilentRequest.d.ts +1 -0
- package/dist/request/SsoSilentRequest.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts +2 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +3 -3
- package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/utils/BrowserConstants.d.ts +8 -0
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +40 -3
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.d.ts +5 -0
- package/dist/utils/BrowserStringUtils.d.ts.map +1 -1
- package/dist/utils/BrowserStringUtils.js +8 -1
- package/dist/utils/BrowserStringUtils.js.map +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/lib/msal-browser.js +710 -410
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +37 -37
- package/package.json +2 -2
|
@@ -16,6 +16,7 @@ import { PopupWindowAttributes } from "./PopupWindowAttributes";
|
|
|
16
16
|
* consent: will the trigger the OAuth consent dialog after the user signs in, asking the user to grant permissions to the app
|
|
17
17
|
* select_account: will interrupt single sign-=on providing account selection experience listing all the accounts in session or any remembered accounts or an option to choose to use a different account
|
|
18
18
|
* create: will direct the user to the account creation experience instead of the log in experience
|
|
19
|
+
* no_session: will not read existing session token when authenticating the user. Upon user being successfully authenticated, EVO won’t create a new session for the user. FOR INTERNAL USE ONLY.
|
|
19
20
|
* - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the login_hint or preferred_username claim.
|
|
20
21
|
* - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.
|
|
21
22
|
* - domainHint - Provides a hint about the tenant or domain that the user should use to sign in. The value of the domain hint is a registered domain for the tenant.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupRequest.d.ts","sourceRoot":"","sources":["../../src/request/PopupRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"PopupRequest.d.ts","sourceRoot":"","sources":["../../src/request/PopupRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,oBAAY,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,GAAC,cAAc,CAAC,CAAC,GAAG;IAC1K,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CACjD,CAAC"}
|
|
@@ -15,6 +15,7 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
|
|
|
15
15
|
* consent: will the trigger the OAuth consent dialog after the user signs in, asking the user to grant permissions to the app
|
|
16
16
|
* select_account: will interrupt single sign-=on providing account selection experience listing all the accounts in session or any remembered accounts or an option to choose to use a different account
|
|
17
17
|
* create: will direct the user to the account creation experience instead of the log in experience
|
|
18
|
+
* no_session: will not read existing session token when authenticating the user. Upon user being successfully authenticated, EVO won’t create a new session for the user. FOR INTERNAL USE ONLY.
|
|
18
19
|
* - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the login_hint or preferred_username claim.
|
|
19
20
|
* - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.
|
|
20
21
|
* - domainHint - Provides a hint about the tenant or domain that the user should use to sign in. The value of the domain hint is a registered domain for the tenant.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectRequest.d.ts","sourceRoot":"","sources":["../../src/request/RedirectRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"RedirectRequest.d.ts","sourceRoot":"","sources":["../../src/request/RedirectRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,oBAAY,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,GAAC,cAAc,CAAC,CAAC,GAAG;IAC7K,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;CACxD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AccountInfo, CommonSilentFlowRequest, StringDict } from "@azure/msal-common";
|
|
2
|
+
import { CacheLookupPolicy } from "../utils/BrowserConstants";
|
|
2
3
|
/**
|
|
3
4
|
* SilentRequest: Request object passed by user to retrieve tokens from the
|
|
4
5
|
* cache, renew an expired token with a refresh token, or retrieve a code (first leg of authorization code grant flow)
|
|
@@ -9,9 +10,13 @@ import { AccountInfo, CommonSilentFlowRequest, StringDict } from "@azure/msal-co
|
|
|
9
10
|
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
|
|
10
11
|
* - account - Account entity to lookup the credentials.
|
|
11
12
|
* - forceRefresh - Forces silent requests to make network calls if true.
|
|
12
|
-
* - extraQueryParameters
|
|
13
|
-
* - tokenQueryParameters
|
|
13
|
+
* - extraQueryParameters - String to string map of custom query parameters added to the /authorize call. Only used when renewing the refresh token.
|
|
14
|
+
* - tokenQueryParameters - String to string map of custom query parameters added to the /token call. Only used when renewing access tokens.
|
|
14
15
|
* - 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. Only used for cases where refresh token is expired.
|
|
16
|
+
* - cacheLookupPolicy - Enum of different ways the silent token can be retrieved.
|
|
17
|
+
* - prompt - Indicates the type of user interaction that is required.
|
|
18
|
+
* none: will ensure that the user isn't presented with any interactive prompt. if request can't be completed via single-sign on, the endpoint will return an interaction_required error
|
|
19
|
+
* no_session: will not read existing session token when authenticating the user. Upon user being successfully authenticated, EVO won’t create a new session for the user. FOR INTERNAL USE ONLY.
|
|
15
20
|
*/
|
|
16
21
|
export declare type SilentRequest = Omit<CommonSilentFlowRequest, "authority" | "correlationId" | "forceRefresh" | "account" | "requestedClaimsHash"> & {
|
|
17
22
|
redirectUri?: string;
|
|
@@ -20,5 +25,7 @@ export declare type SilentRequest = Omit<CommonSilentFlowRequest, "authority" |
|
|
|
20
25
|
account?: AccountInfo;
|
|
21
26
|
correlationId?: string;
|
|
22
27
|
forceRefresh?: boolean;
|
|
28
|
+
cacheLookupPolicy?: CacheLookupPolicy;
|
|
29
|
+
prompt?: string;
|
|
23
30
|
};
|
|
24
31
|
//# sourceMappingURL=SilentRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,aAAa,GAAG,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAC,eAAe,GAAC,cAAc,GAAC,SAAS,GAAC,qBAAqB,CAAC,GAAG;IACpI,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -15,6 +15,7 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
|
|
|
15
15
|
* consent: will trigger the OAuth consent dialog after the user signs in, asking the user to grant permissions to the app
|
|
16
16
|
* select_account: will interrupt single sign-=on providing account selection experience listing all the accounts in session or any remembered accounts or an option to choose to use a different account
|
|
17
17
|
* create: will direct the user to the account creation experience instead of the log in experience
|
|
18
|
+
* no_session: will not read existing session token when authenticating the user. Upon user being successfully authenticated, EVO won’t create a new session for the user. FOR INTERNAL USE ONLY.
|
|
18
19
|
* - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the login_hint or preferred_username claim.
|
|
19
20
|
* - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.
|
|
20
21
|
* - domainHint - Provides a hint about the tenant or domain that the user should use to sign in. The value of the domain hint is a registered domain for the tenant.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsoSilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SsoSilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"SsoSilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SsoSilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oBAAY,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,GAAC,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Logger, PerformanceEvents, IPerformanceClient, PerformanceClient, IPerformanceMeasurement, InProgressPerformanceEvent, ApplicationTelemetry } from "@azure/msal-common";
|
|
2
|
+
import { CryptoOptions } from "../config/Configuration";
|
|
2
3
|
export declare class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient {
|
|
3
4
|
private browserCrypto;
|
|
4
5
|
private guidGenerator;
|
|
5
|
-
constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry);
|
|
6
|
+
constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry, cryptoOptions: CryptoOptions);
|
|
6
7
|
startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement;
|
|
7
8
|
generateId(): string;
|
|
8
9
|
private getPageVisibility;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserPerformanceClient.d.ts","sourceRoot":"","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAoB,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"BrowserPerformanceClient.d.ts","sourceRoot":"","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAoB,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACnM,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD,qBAAa,wBAAyB,SAAQ,iBAAkB,YAAW,kBAAkB;IACzF,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,aAAa,CAAgB;gBAEzB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa;IAMtL,4BAA4B,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,uBAAuB;IAIjG,UAAU,IAAK,MAAM;IAIrB,OAAO,CAAC,iBAAiB;IAIzB;;;;;;;OAOG;IACH,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,0BAA0B;CAiBvG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.29.0 2022-10-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { PerformanceClient } from '@azure/msal-common';
|
|
@@ -12,9 +12,9 @@ import { BrowserPerformanceMeasurement } from './BrowserPerformanceMeasurement.j
|
|
|
12
12
|
*/
|
|
13
13
|
var BrowserPerformanceClient = /** @class */ (function (_super) {
|
|
14
14
|
__extends(BrowserPerformanceClient, _super);
|
|
15
|
-
function BrowserPerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) {
|
|
15
|
+
function BrowserPerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, cryptoOptions) {
|
|
16
16
|
var _this = _super.call(this, clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) || this;
|
|
17
|
-
_this.browserCrypto = new BrowserCrypto(_this.logger);
|
|
17
|
+
_this.browserCrypto = new BrowserCrypto(_this.logger, cryptoOptions);
|
|
18
18
|
_this.guidGenerator = new GuidGenerator(_this.browserCrypto);
|
|
19
19
|
return _this;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserPerformanceClient.js","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Logger, PerformanceEvent, PerformanceEvents, IPerformanceClient, PerformanceClient, IPerformanceMeasurement, InProgressPerformanceEvent, ApplicationTelemetry } from \"@azure/msal-common\";\nimport { BrowserCrypto } from \"../crypto/BrowserCrypto\";\nimport { GuidGenerator } from \"../crypto/GuidGenerator\";\nimport { BrowserPerformanceMeasurement } from \"./BrowserPerformanceMeasurement\";\n\nexport class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient {\n private browserCrypto: BrowserCrypto;\n private guidGenerator: GuidGenerator;\n \n constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry) {\n super(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry);\n this.browserCrypto = new BrowserCrypto(this.logger);\n this.guidGenerator = new GuidGenerator(this.browserCrypto);\n }\n \n startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement {\n return new BrowserPerformanceMeasurement(measureName, correlationId);\n }\n\n generateId() : string {\n return this.guidGenerator.generateGuid();\n }\n\n private getPageVisibility(): string | null {\n return document.visibilityState?.toString() || null;\n }\n \n /**\n * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.\n * Also captures browser page visibilityState.\n *\n * @param {PerformanceEvents} measureName\n * @param {?string} [correlationId]\n * @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}\n */\n startMeasurement(measureName: PerformanceEvents, correlationId?: string): InProgressPerformanceEvent {\n // Capture page visibilityState and then invoke start/end measurement\n const startPageVisibility = this.getPageVisibility();\n \n const inProgressEvent = super.startMeasurement(measureName, correlationId);\n\n return {\n ...inProgressEvent,\n endMeasurement: (event?: Partial<PerformanceEvent>): PerformanceEvent | null => {\n return inProgressEvent.endMeasurement({\n startPageVisibility,\n endPageVisibility: this.getPageVisibility(),\n ...event\n });\n }\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;
|
|
1
|
+
{"version":3,"file":"BrowserPerformanceClient.js","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Logger, PerformanceEvent, PerformanceEvents, IPerformanceClient, PerformanceClient, IPerformanceMeasurement, InProgressPerformanceEvent, ApplicationTelemetry } from \"@azure/msal-common\";\nimport { CryptoOptions } from \"../config/Configuration\";\nimport { BrowserCrypto } from \"../crypto/BrowserCrypto\";\nimport { GuidGenerator } from \"../crypto/GuidGenerator\";\nimport { BrowserPerformanceMeasurement } from \"./BrowserPerformanceMeasurement\";\n\nexport class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient {\n private browserCrypto: BrowserCrypto;\n private guidGenerator: GuidGenerator;\n \n constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry, cryptoOptions: CryptoOptions) {\n super(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry);\n this.browserCrypto = new BrowserCrypto(this.logger, cryptoOptions);\n this.guidGenerator = new GuidGenerator(this.browserCrypto);\n }\n \n startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement {\n return new BrowserPerformanceMeasurement(measureName, correlationId);\n }\n\n generateId() : string {\n return this.guidGenerator.generateGuid();\n }\n\n private getPageVisibility(): string | null {\n return document.visibilityState?.toString() || null;\n }\n \n /**\n * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.\n * Also captures browser page visibilityState.\n *\n * @param {PerformanceEvents} measureName\n * @param {?string} [correlationId]\n * @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}\n */\n startMeasurement(measureName: PerformanceEvents, correlationId?: string): InProgressPerformanceEvent {\n // Capture page visibilityState and then invoke start/end measurement\n const startPageVisibility = this.getPageVisibility();\n \n const inProgressEvent = super.startMeasurement(measureName, correlationId);\n\n return {\n ...inProgressEvent,\n endMeasurement: (event?: Partial<PerformanceEvent>): PerformanceEvent | null => {\n return inProgressEvent.endMeasurement({\n startPageVisibility,\n endPageVisibility: this.getPageVisibility(),\n ...event\n });\n }\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAW8C,4CAAiB;IAI3D,kCAAY,QAAgB,EAAE,SAAiB,EAAE,MAAc,EAAE,WAAmB,EAAE,cAAsB,EAAE,oBAA0C,EAAE,aAA4B;QAAtL,YACI,kBAAM,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,oBAAoB,CAAC,SAGxF;QAFG,KAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,KAAI,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACnE,KAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC;;KAC9D;IAED,+DAA4B,GAA5B,UAA6B,WAAmB,EAAE,aAAqB;QACnE,OAAO,IAAI,6BAA6B,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;KACxE;IAED,6CAAU,GAAV;QACI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;KAC5C;IAEO,oDAAiB,GAAzB;;QACI,OAAO,OAAA,QAAQ,CAAC,eAAe,0CAAE,QAAQ,OAAM,IAAI,CAAC;KACvD;;;;;;;;;IAUD,mDAAgB,GAAhB,UAAiB,WAA8B,EAAE,aAAsB;QAAvE,iBAgBC;;QAdG,IAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAErD,IAAM,eAAe,GAAG,iBAAM,gBAAgB,YAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QAE3E,6BACO,eAAe,KAClB,cAAc,EAAE,UAAC,KAAiC;gBAC9C,OAAO,eAAe,CAAC,cAAc,YACjC,mBAAmB,qBAAA,EACnB,iBAAiB,EAAE,KAAI,CAAC,iBAAiB,EAAE,IACxC,KAAK,EACV,CAAC;aACN,IACH;KACL;IACL,+BAAC;AAAD,CA/CA,CAA8C,iBAAiB;;;;"}
|
|
@@ -151,4 +151,12 @@ export declare enum WrapperSKU {
|
|
|
151
151
|
export declare const DB_NAME = "msal.db";
|
|
152
152
|
export declare const DB_VERSION = 1;
|
|
153
153
|
export declare const DB_TABLE_NAME: string;
|
|
154
|
+
export declare enum CacheLookupPolicy {
|
|
155
|
+
Default = 0,
|
|
156
|
+
AccessToken = 1,
|
|
157
|
+
AccessTokenAndRefreshToken = 2,
|
|
158
|
+
RefreshToken = 3,
|
|
159
|
+
RefreshTokenAndNetwork = 4,
|
|
160
|
+
Skip = 5
|
|
161
|
+
}
|
|
154
162
|
//# sourceMappingURL=BrowserConstants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserConstants.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserConstants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEN,CAAC;AAEF,eAAO,MAAM,eA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
|
1
|
+
/*! @azure/msal-browser v2.29.0 2022-10-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common';
|
|
4
4
|
|
|
@@ -172,7 +172,44 @@ var WrapperSKU;
|
|
|
172
172
|
// DatabaseStorage Constants
|
|
173
173
|
var DB_NAME = "msal.db";
|
|
174
174
|
var DB_VERSION = 1;
|
|
175
|
-
var DB_TABLE_NAME = DB_NAME + ".keys";
|
|
175
|
+
var DB_TABLE_NAME = DB_NAME + ".keys";
|
|
176
|
+
var CacheLookupPolicy;
|
|
177
|
+
(function (CacheLookupPolicy) {
|
|
178
|
+
/*
|
|
179
|
+
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired
|
|
180
|
+
* or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token
|
|
181
|
+
* is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.
|
|
182
|
+
*/
|
|
183
|
+
CacheLookupPolicy[CacheLookupPolicy["Default"] = 0] = "Default";
|
|
184
|
+
/*
|
|
185
|
+
* acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or
|
|
186
|
+
* refresh tokens.
|
|
187
|
+
*/
|
|
188
|
+
CacheLookupPolicy[CacheLookupPolicy["AccessToken"] = 1] = "AccessToken";
|
|
189
|
+
/*
|
|
190
|
+
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or
|
|
191
|
+
* cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it
|
|
192
|
+
* will not be renewed and acquireTokenSilent will fail.
|
|
193
|
+
*/
|
|
194
|
+
CacheLookupPolicy[CacheLookupPolicy["AccessTokenAndRefreshToken"] = 2] = "AccessTokenAndRefreshToken";
|
|
195
|
+
/*
|
|
196
|
+
* acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to
|
|
197
|
+
* exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be
|
|
198
|
+
* renewed and acquireTokenSilent will fail.
|
|
199
|
+
*/
|
|
200
|
+
CacheLookupPolicy[CacheLookupPolicy["RefreshToken"] = 3] = "RefreshToken";
|
|
201
|
+
/*
|
|
202
|
+
* acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the
|
|
203
|
+
* cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to
|
|
204
|
+
* setting "forceRefresh: true".
|
|
205
|
+
*/
|
|
206
|
+
CacheLookupPolicy[CacheLookupPolicy["RefreshTokenAndNetwork"] = 4] = "RefreshTokenAndNetwork";
|
|
207
|
+
/*
|
|
208
|
+
* acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will
|
|
209
|
+
* always fail if 3rd party cookies are blocked by the browser.
|
|
210
|
+
*/
|
|
211
|
+
CacheLookupPolicy[CacheLookupPolicy["Skip"] = 5] = "Skip";
|
|
212
|
+
})(CacheLookupPolicy || (CacheLookupPolicy = {}));
|
|
176
213
|
|
|
177
|
-
export { ApiId, BrowserCacheLocation, BrowserConstants, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, NativeConstants, NativeExtensionMethod, TemporaryCacheKeys, WrapperSKU };
|
|
214
|
+
export { ApiId, BrowserCacheLocation, BrowserConstants, CacheLookupPolicy, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, NativeConstants, NativeExtensionMethod, TemporaryCacheKeys, WrapperSKU };
|
|
178
215
|
//# sourceMappingURL=BrowserConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserConstants.js","sources":["../../src/utils/BrowserConstants.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { OIDC_DEFAULT_SCOPES } from \"@azure/msal-common\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\n\n/**\n * Constants\n */\nexport const BrowserConstants = {\n /**\n * Interaction in progress cache value\n */\n INTERACTION_IN_PROGRESS_VALUE: \"interaction_in_progress\",\n /**\n * Invalid grant error code\n */\n INVALID_GRANT_ERROR: \"invalid_grant\",\n /**\n * Default popup window width\n */\n POPUP_WIDTH: 483,\n /**\n * Default popup window height\n */\n POPUP_HEIGHT: 600,\n /**\n * Name of the popup window starts with\n */\n POPUP_NAME_PREFIX: \"msal\",\n /**\n * Default popup monitor poll interval in milliseconds\n */\n POLL_INTERVAL_MS: 50,\n /**\n * Msal-browser SKU\n */\n MSAL_SKU: \"msal.js.browser\",\n};\n\nexport const NativeConstants = {\n CHANNEL_ID: \"53ee284d-920a-4b59-9d30-a60315b26836\",\n PREFERRED_EXTENSION_ID: \"ppnbnpeolgkicgegkbkbjmhlideopiji\",\n MATS_TELEMETRY: \"MATS\"\n};\n\nexport enum NativeExtensionMethod {\n HandshakeRequest = \"Handshake\",\n HandshakeResponse = \"HandshakeResponse\",\n GetToken = \"GetToken\",\n Response = \"Response\"\n}\n\nexport enum BrowserCacheLocation {\n LocalStorage = \"localStorage\",\n SessionStorage = \"sessionStorage\",\n MemoryStorage = \"memoryStorage\"\n}\n\n/**\n * HTTP Request types supported by MSAL.\n */\nexport enum HTTP_REQUEST_TYPE {\n GET = \"GET\",\n POST = \"POST\"\n}\n\n/**\n * Temporary cache keys for MSAL, deleted after any request.\n */\nexport enum TemporaryCacheKeys {\n AUTHORITY = \"authority\",\n ACQUIRE_TOKEN_ACCOUNT = \"acquireToken.account\",\n SESSION_STATE = \"session.state\",\n REQUEST_STATE = \"request.state\",\n NONCE_IDTOKEN = \"nonce.id_token\",\n ORIGIN_URI = \"request.origin\",\n RENEW_STATUS = \"token.renew.status\",\n URL_HASH = \"urlHash\",\n REQUEST_PARAMS = \"request.params\",\n SCOPES = \"scopes\",\n INTERACTION_STATUS_KEY = \"interaction.status\",\n CCS_CREDENTIAL = \"ccs.credential\",\n CORRELATION_ID = \"request.correlationId\",\n NATIVE_REQUEST = \"request.native\"\n}\n\n/**\n * Cache keys stored in-memory\n */\nexport enum InMemoryCacheKeys {\n WRAPPER_SKU = \"wrapper.sku\",\n WRAPPER_VER = \"wrapper.version\"\n}\n\n/**\n * API Codes for Telemetry purposes. \n * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs\n * 0-99 Silent Flow\n * 800-899 Auth Code Flow\n */\nexport enum ApiId {\n acquireTokenRedirect = 861,\n acquireTokenPopup = 862,\n ssoSilent = 863,\n acquireTokenSilent_authCode = 864,\n handleRedirectPromise = 865,\n acquireTokenByCode = 866,\n acquireTokenSilent_silentFlow = 61,\n logout = 961,\n logoutPopup = 962\n}\n\n/*\n * Interaction type of the API - used for state and telemetry\n */\nexport enum InteractionType {\n Redirect = \"redirect\",\n Popup = \"popup\",\n Silent = \"silent\",\n None = \"none\"\n}\n\n/**\n * Types of interaction currently in progress.\n * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.\n */\nexport enum InteractionStatus {\n /**\n * Initial status before interaction occurs\n */\n Startup = \"startup\",\n /**\n * Status set when all login calls occuring\n */\n Login = \"login\",\n /**\n * Status set when logout call occuring\n */ \n Logout = \"logout\",\n /**\n * Status set for acquireToken calls\n */\n AcquireToken = \"acquireToken\",\n /**\n * Status set for ssoSilent calls\n */\n SsoSilent = \"ssoSilent\",\n /**\n * Status set when handleRedirect in progress\n */\n HandleRedirect = \"handleRedirect\",\n /**\n * Status set when interaction is complete\n */\n None = \"none\"\n}\n\nexport const DEFAULT_REQUEST: RedirectRequest|PopupRequest = {\n scopes: OIDC_DEFAULT_SCOPES\n};\n\n/**\n * JWK Key Format string (Type MUST be defined for window crypto APIs)\n */\nexport const KEY_FORMAT_JWK = \"jwk\";\n\n// Supported wrapper SKUs\nexport enum WrapperSKU {\n React = \"@azure/msal-react\",\n Angular = \"@azure/msal-angular\"\n}\n\n// DatabaseStorage Constants\nexport const DB_NAME = \"msal.db\";\nexport const DB_VERSION = 1;\nexport const DB_TABLE_NAME = `${DB_NAME}.keys`;\n"],"names":[],"mappings":";;;;AAAA;;;;AASA;;;IAGa,gBAAgB,GAAG;;;;IAI5B,6BAA6B,EAAE,yBAAyB;;;;IAIxD,mBAAmB,EAAE,eAAe;;;;IAIpC,WAAW,EAAE,GAAG;;;;IAIhB,YAAY,EAAE,GAAG;;;;IAIjB,iBAAiB,EAAE,MAAM;;;;IAIzB,gBAAgB,EAAE,EAAE;;;;IAIpB,QAAQ,EAAE,iBAAiB;EAC7B;IAEW,eAAe,GAAG;IAC3B,UAAU,EAAE,sCAAsC;IAClD,sBAAsB,EAAE,kCAAkC;IAC1D,cAAc,EAAE,MAAM;EACxB;IAEU;AAAZ,WAAY,qBAAqB;IAC7B,uDAA8B,CAAA;IAC9B,gEAAuC,CAAA;IACvC,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;AACzB,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;IAEW;AAAZ,WAAY,oBAAoB;IAC5B,qDAA6B,CAAA;IAC7B,yDAAiC,CAAA;IACjC,uDAA+B,CAAA;AACnC,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED;;;IAGY;AAAZ,WAAY,iBAAiB;IACzB,gCAAW,CAAA;IACX,kCAAa,CAAA;AACjB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED;;;IAGY;AAAZ,WAAY,kBAAkB;IAC1B,6CAAuB,CAAA;IACvB,oEAA8C,CAAA;IAC9C,qDAA+B,CAAA;IAC/B,qDAA+B,CAAA;IAC/B,sDAAgC,CAAA;IAChC,mDAA6B,CAAA;IAC7B,yDAAmC,CAAA;IACnC,0CAAoB,CAAA;IACpB,uDAAiC,CAAA;IACjC,uCAAiB,CAAA;IACjB,mEAA6C,CAAA;IAC7C,uDAAiC,CAAA;IACjC,8DAAwC,C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["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { OIDC_DEFAULT_SCOPES } from \"@azure/msal-common\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\n\n/**\n * Constants\n */\nexport const BrowserConstants = {\n /**\n * Interaction in progress cache value\n */\n INTERACTION_IN_PROGRESS_VALUE: \"interaction_in_progress\",\n /**\n * Invalid grant error code\n */\n INVALID_GRANT_ERROR: \"invalid_grant\",\n /**\n * Default popup window width\n */\n POPUP_WIDTH: 483,\n /**\n * Default popup window height\n */\n POPUP_HEIGHT: 600,\n /**\n * Name of the popup window starts with\n */\n POPUP_NAME_PREFIX: \"msal\",\n /**\n * Default popup monitor poll interval in milliseconds\n */\n POLL_INTERVAL_MS: 50,\n /**\n * Msal-browser SKU\n */\n MSAL_SKU: \"msal.js.browser\",\n};\n\nexport const NativeConstants = {\n CHANNEL_ID: \"53ee284d-920a-4b59-9d30-a60315b26836\",\n PREFERRED_EXTENSION_ID: \"ppnbnpeolgkicgegkbkbjmhlideopiji\",\n MATS_TELEMETRY: \"MATS\"\n};\n\nexport enum NativeExtensionMethod {\n HandshakeRequest = \"Handshake\",\n HandshakeResponse = \"HandshakeResponse\",\n GetToken = \"GetToken\",\n Response = \"Response\"\n}\n\nexport enum BrowserCacheLocation {\n LocalStorage = \"localStorage\",\n SessionStorage = \"sessionStorage\",\n MemoryStorage = \"memoryStorage\"\n}\n\n/**\n * HTTP Request types supported by MSAL.\n */\nexport enum HTTP_REQUEST_TYPE {\n GET = \"GET\",\n POST = \"POST\"\n}\n\n/**\n * Temporary cache keys for MSAL, deleted after any request.\n */\nexport enum TemporaryCacheKeys {\n AUTHORITY = \"authority\",\n ACQUIRE_TOKEN_ACCOUNT = \"acquireToken.account\",\n SESSION_STATE = \"session.state\",\n REQUEST_STATE = \"request.state\",\n NONCE_IDTOKEN = \"nonce.id_token\",\n ORIGIN_URI = \"request.origin\",\n RENEW_STATUS = \"token.renew.status\",\n URL_HASH = \"urlHash\",\n REQUEST_PARAMS = \"request.params\",\n SCOPES = \"scopes\",\n INTERACTION_STATUS_KEY = \"interaction.status\",\n CCS_CREDENTIAL = \"ccs.credential\",\n CORRELATION_ID = \"request.correlationId\",\n NATIVE_REQUEST = \"request.native\"\n}\n\n/**\n * Cache keys stored in-memory\n */\nexport enum InMemoryCacheKeys {\n WRAPPER_SKU = \"wrapper.sku\",\n WRAPPER_VER = \"wrapper.version\"\n}\n\n/**\n * API Codes for Telemetry purposes. \n * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs\n * 0-99 Silent Flow\n * 800-899 Auth Code Flow\n */\nexport enum ApiId {\n acquireTokenRedirect = 861,\n acquireTokenPopup = 862,\n ssoSilent = 863,\n acquireTokenSilent_authCode = 864,\n handleRedirectPromise = 865,\n acquireTokenByCode = 866,\n acquireTokenSilent_silentFlow = 61,\n logout = 961,\n logoutPopup = 962\n}\n\n/*\n * Interaction type of the API - used for state and telemetry\n */\nexport enum InteractionType {\n Redirect = \"redirect\",\n Popup = \"popup\",\n Silent = \"silent\",\n None = \"none\"\n}\n\n/**\n * Types of interaction currently in progress.\n * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.\n */\nexport enum InteractionStatus {\n /**\n * Initial status before interaction occurs\n */\n Startup = \"startup\",\n /**\n * Status set when all login calls occuring\n */\n Login = \"login\",\n /**\n * Status set when logout call occuring\n */ \n Logout = \"logout\",\n /**\n * Status set for acquireToken calls\n */\n AcquireToken = \"acquireToken\",\n /**\n * Status set for ssoSilent calls\n */\n SsoSilent = \"ssoSilent\",\n /**\n * Status set when handleRedirect in progress\n */\n HandleRedirect = \"handleRedirect\",\n /**\n * Status set when interaction is complete\n */\n None = \"none\"\n}\n\nexport const DEFAULT_REQUEST: RedirectRequest|PopupRequest = {\n scopes: OIDC_DEFAULT_SCOPES\n};\n\n/**\n * JWK Key Format string (Type MUST be defined for window crypto APIs)\n */\nexport const KEY_FORMAT_JWK = \"jwk\";\n\n// Supported wrapper SKUs\nexport enum WrapperSKU {\n React = \"@azure/msal-react\",\n Angular = \"@azure/msal-angular\"\n}\n\n// DatabaseStorage Constants\nexport const DB_NAME = \"msal.db\";\nexport const DB_VERSION = 1;\nexport const DB_TABLE_NAME = `${DB_NAME}.keys`;\n\nexport enum CacheLookupPolicy {\n /*\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired\n * or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token\n * is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.\n */\n Default = 0, // 0 is falsy, is equivalent to not passing in a CacheLookupPolicy\n /*\n * acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or\n * refresh tokens.\n */\n AccessToken = 1,\n /*\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or\n * cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it\n * will not be renewed and acquireTokenSilent will fail.\n */\n AccessTokenAndRefreshToken = 2,\n /*\n * acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to\n * exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be\n * renewed and acquireTokenSilent will fail.\n */\n RefreshToken = 3,\n /*\n * acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the\n * cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to\n * setting \"forceRefresh: true\".\n */\n RefreshTokenAndNetwork = 4,\n /*\n * acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will\n * always fail if 3rd party cookies are blocked by the browser.\n */\n Skip = 5,\n}\n"],"names":[],"mappings":";;;;AAAA;;;;AASA;;;IAGa,gBAAgB,GAAG;;;;IAI5B,6BAA6B,EAAE,yBAAyB;;;;IAIxD,mBAAmB,EAAE,eAAe;;;;IAIpC,WAAW,EAAE,GAAG;;;;IAIhB,YAAY,EAAE,GAAG;;;;IAIjB,iBAAiB,EAAE,MAAM;;;;IAI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C3B,+DAAwB,CAAA;IACxB,oFAAkC,CAAA;IAClC,uCAAY,CAAA;IACZ,iDAAiB,CAAA;AACrB,CAAC,EAVW,KAAK,KAAL,KAAK,QAUhB;AAED;;;IAGY;AAAZ,WAAY,eAAe;IACvB,wCAAqB,CAAA;IACrB,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,gCAAa,CAAA;AACjB,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAED;;;;IAIY;AAAZ,WAAY,iBAAiB;;;;IAIzB,wCAAmB,CAAA;;;;IAInB,oCAAe,CAAA;;;;IAIf,sCAAiB,CAAA;;;;IAIjB,kDAA6B,CAAA;;;;IAI7B,4CAAuB,CAAA;;;;IAIvB,sDAAiC,CAAA;;;;IAIjC,kCAAa,CAAA;AACjB,CAAC,EA7BW,iBAAiB,KAAjB,iBAAiB,QA6B5B;IAEY,eAAe,GAAiC;IACzD,MAAM,EAAE,mBAAmB;EAC7B;AAEF;;;IAGa,cAAc,GAAG,MAAM;AAEpC;IACY;AAAZ,WAAY,UAAU;IAClB,yCAA2B,CAAA;IAC3B,6CAA+B,CAAA;AACnC,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED;IACa,OAAO,GAAG,UAAU;IACpB,UAAU,GAAG,EAAE;IACf,aAAa,GAAM,OAAO,WAAQ;IAEnC;AAAZ,WAAY,iBAAiB;;;;;;IAMzB,+DAAW,CAAA;;;;;IAKX,uEAAe,CAAA;;;;;;IAMf,qGAA8B,CAAA;;;;;;IAM9B,yEAAgB,CAAA;;;;;;IAMhB,6FAA0B,CAAA;;;;;IAK1B,yDAAQ,CAAA;AACZ,CAAC,EAnCW,iBAAiB,KAAjB,iBAAiB;;;;"}
|
|
@@ -18,5 +18,10 @@ export declare class BrowserStringUtils {
|
|
|
18
18
|
* @param aBytes
|
|
19
19
|
*/
|
|
20
20
|
static utf8ArrToString(aBytes: Uint8Array): string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns stringified jwk.
|
|
23
|
+
* @param jwk
|
|
24
|
+
*/
|
|
25
|
+
static getSortedObjectString(obj: object): string;
|
|
21
26
|
}
|
|
22
27
|
//# sourceMappingURL=BrowserStringUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserStringUtils.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserStringUtils.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,qBAAa,kBAAkB;IAE3B;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAE,OAAO,EAAE,MAAM,GAAG,UAAU;IAuDpD;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW;IAS3D;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAE,MAAM,EAAE,UAAU,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"BrowserStringUtils.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserStringUtils.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,qBAAa,kBAAkB;IAE3B;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAE,OAAO,EAAE,MAAM,GAAG,UAAU;IAuDpD;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW;IAS3D;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAE,MAAM,EAAE,UAAU,GAAG,MAAM;IAuBnD;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAGpD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.29.0 2022-10-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { Constants } from '@azure/msal-common';
|
|
4
4
|
|
|
@@ -108,6 +108,13 @@ var BrowserStringUtils = /** @class */ (function () {
|
|
|
108
108
|
}
|
|
109
109
|
return sView;
|
|
110
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* Returns stringified jwk.
|
|
113
|
+
* @param jwk
|
|
114
|
+
*/
|
|
115
|
+
BrowserStringUtils.getSortedObjectString = function (obj) {
|
|
116
|
+
return JSON.stringify(obj, Object.keys(obj).sort());
|
|
117
|
+
};
|
|
111
118
|
return BrowserStringUtils;
|
|
112
119
|
}());
|
|
113
120
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserStringUtils.js","sources":["../../src/utils/BrowserStringUtils.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants } from \"@azure/msal-common\";\n\n/**\n * Utility functions for strings in a browser. See here for implementation details:\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64\n */\nexport class BrowserStringUtils {\n\n /**\n * Converts string to Uint8Array\n * @param sDOMStr \n */\n static stringToUtf8Arr (sDOMStr: string): Uint8Array {\n let nChr;\n let nArrLen = 0;\n const nStrLen = sDOMStr.length;\n /* mapping... */\n for (let nMapIdx = 0; nMapIdx < nStrLen; nMapIdx++) {\n nChr = sDOMStr.charCodeAt(nMapIdx);\n nArrLen += nChr < 0x80 ? 1 : nChr < 0x800 ? 2 : nChr < 0x10000 ? 3 : nChr < 0x200000 ? 4 : nChr < 0x4000000 ? 5 : 6;\n }\n\n const aBytes = new Uint8Array(nArrLen);\n\n /* transcription... */\n\n for (let nIdx = 0, nChrIdx = 0; nIdx < nArrLen; nChrIdx++) {\n nChr = sDOMStr.charCodeAt(nChrIdx);\n if (nChr < 128) {\n /* one byte */\n aBytes[nIdx++] = nChr;\n } else if (nChr < 0x800) {\n /* two bytes */\n aBytes[nIdx++] = 192 + (nChr >>> 6);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else if (nChr < 0x10000) {\n /* three bytes */\n aBytes[nIdx++] = 224 + (nChr >>> 12);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else if (nChr < 0x200000) {\n /* four bytes */\n aBytes[nIdx++] = 240 + (nChr >>> 18);\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else if (nChr < 0x4000000) {\n /* five bytes */\n aBytes[nIdx++] = 248 + (nChr >>> 24);\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else /* if (nChr <= 0x7fffffff) */ {\n /* six bytes */\n aBytes[nIdx++] = 252 + (nChr >>> 30);\n aBytes[nIdx++] = 128 + (nChr >>> 24 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n }\n }\n\n return aBytes; \n }\n\n /**\n * Converst string to ArrayBuffer\n * @param dataString \n */\n static stringToArrayBuffer(dataString: string): ArrayBuffer {\n const data = new ArrayBuffer(dataString.length);\n const dataView = new Uint8Array(data);\n for (let i: number = 0; i < dataString.length; i++) {\n dataView[i] = dataString.charCodeAt(i);\n }\n return data;\n }\n\n /**\n * Converts Uint8Array to a string\n * @param aBytes \n */\n static utf8ArrToString (aBytes: Uint8Array): string {\n let sView = Constants.EMPTY_STRING;\n for (let nPart, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {\n nPart = aBytes[nIdx];\n sView += String.fromCharCode(\n nPart > 251 && nPart < 254 && nIdx + 5 < nLen ? /* six bytes */\n /* (nPart - 252 << 30) may be not so safe in ECMAScript! So...: */\n (nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ? /* five bytes */\n (nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ? /* four bytes */\n (nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ? /* three bytes */\n (nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 191 && nPart < 224 && nIdx + 1 < nLen ? /* two bytes */\n (nPart - 192 << 6) + aBytes[++nIdx] - 128\n : /* nPart < 127 ? */ /* one byte */\n nPart\n );\n }\n return sView;\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;;AAOA;;;;;IAIA;
|
|
1
|
+
{"version":3,"file":"BrowserStringUtils.js","sources":["../../src/utils/BrowserStringUtils.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants } from \"@azure/msal-common\";\n\n/**\n * Utility functions for strings in a browser. See here for implementation details:\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64\n */\nexport class BrowserStringUtils {\n\n /**\n * Converts string to Uint8Array\n * @param sDOMStr \n */\n static stringToUtf8Arr (sDOMStr: string): Uint8Array {\n let nChr;\n let nArrLen = 0;\n const nStrLen = sDOMStr.length;\n /* mapping... */\n for (let nMapIdx = 0; nMapIdx < nStrLen; nMapIdx++) {\n nChr = sDOMStr.charCodeAt(nMapIdx);\n nArrLen += nChr < 0x80 ? 1 : nChr < 0x800 ? 2 : nChr < 0x10000 ? 3 : nChr < 0x200000 ? 4 : nChr < 0x4000000 ? 5 : 6;\n }\n\n const aBytes = new Uint8Array(nArrLen);\n\n /* transcription... */\n\n for (let nIdx = 0, nChrIdx = 0; nIdx < nArrLen; nChrIdx++) {\n nChr = sDOMStr.charCodeAt(nChrIdx);\n if (nChr < 128) {\n /* one byte */\n aBytes[nIdx++] = nChr;\n } else if (nChr < 0x800) {\n /* two bytes */\n aBytes[nIdx++] = 192 + (nChr >>> 6);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else if (nChr < 0x10000) {\n /* three bytes */\n aBytes[nIdx++] = 224 + (nChr >>> 12);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else if (nChr < 0x200000) {\n /* four bytes */\n aBytes[nIdx++] = 240 + (nChr >>> 18);\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else if (nChr < 0x4000000) {\n /* five bytes */\n aBytes[nIdx++] = 248 + (nChr >>> 24);\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else /* if (nChr <= 0x7fffffff) */ {\n /* six bytes */\n aBytes[nIdx++] = 252 + (nChr >>> 30);\n aBytes[nIdx++] = 128 + (nChr >>> 24 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n }\n }\n\n return aBytes; \n }\n\n /**\n * Converst string to ArrayBuffer\n * @param dataString \n */\n static stringToArrayBuffer(dataString: string): ArrayBuffer {\n const data = new ArrayBuffer(dataString.length);\n const dataView = new Uint8Array(data);\n for (let i: number = 0; i < dataString.length; i++) {\n dataView[i] = dataString.charCodeAt(i);\n }\n return data;\n }\n\n /**\n * Converts Uint8Array to a string\n * @param aBytes \n */\n static utf8ArrToString (aBytes: Uint8Array): string {\n let sView = Constants.EMPTY_STRING;\n for (let nPart, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {\n nPart = aBytes[nIdx];\n sView += String.fromCharCode(\n nPart > 251 && nPart < 254 && nIdx + 5 < nLen ? /* six bytes */\n /* (nPart - 252 << 30) may be not so safe in ECMAScript! So...: */\n (nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ? /* five bytes */\n (nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ? /* four bytes */\n (nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ? /* three bytes */\n (nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 191 && nPart < 224 && nIdx + 1 < nLen ? /* two bytes */\n (nPart - 192 << 6) + aBytes[++nIdx] - 128\n : /* nPart < 127 ? */ /* one byte */\n nPart\n );\n }\n return sView;\n }\n\n /**\n * Returns stringified jwk.\n * @param jwk \n */\n static getSortedObjectString(obj: object): string {\n return JSON.stringify(obj, Object.keys(obj).sort());\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;;AAOA;;;;;IAIA;KA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