Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@azure/msal-angular

Package Overview
Dependencies
Maintainers
3
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/msal-angular - npm Package Compare versions

Comparing version 2.5.3 to 2.5.4

2

azure-msal-angular.metadata.json

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"MsalService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":24,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":30,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INSTANCE"}]}],null],"parameters":[{"__symbolic":"reference","module":"@azure/msal-browser","name":"IPublicClientApplication","line":30,"character":48},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":31,"character":26}]}],"initialize":[{"__symbolic":"method"}],"acquireTokenPopup":[{"__symbolic":"method"}],"acquireTokenRedirect":[{"__symbolic":"method"}],"acquireTokenSilent":[{"__symbolic":"method"}],"handleRedirectObservable":[{"__symbolic":"method"}],"loginPopup":[{"__symbolic":"method"}],"loginRedirect":[{"__symbolic":"method"}],"logout":[{"__symbolic":"method"}],"logoutRedirect":[{"__symbolic":"method"}],"logoutPopup":[{"__symbolic":"method"}],"ssoSilent":[{"__symbolic":"method"}],"getLogger":[{"__symbolic":"method"}],"setLogger":[{"__symbolic":"method"}]}},"IMsalService":{"__symbolic":"interface"},"MsalGuard":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":21,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_GUARD_CONFIG"}]}],null,null,null,null],"parameters":[{"__symbolic":"reference","name":"MsalGuardConfiguration"},{"__symbolic":"reference","name":"MsalBroadcastService"},{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":24,"character":26},{"__symbolic":"reference","module":"@angular/router","name":"Router","line":25,"character":24}]}],"parseUrl":[{"__symbolic":"method"}],"getDestinationUrl":[{"__symbolic":"method"}],"loginInteractively":[{"__symbolic":"method"}],"activateHelper":[{"__symbolic":"method"}],"includesCode":[{"__symbolic":"method"}],"canActivate":[{"__symbolic":"method"}],"canActivateChild":[{"__symbolic":"method"}],"canLoad":[{"__symbolic":"method"}]}},"MsalGuardConfiguration":{"__symbolic":"interface"},"MsalGuardAuthRequest":{"__symbolic":"interface"},"MsalInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":20,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":25,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INTERCEPTOR_CONFIG"}]}],null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":29,"character":9},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":29,"character":16}]}]],"parameters":[{"__symbolic":"reference","name":"MsalInterceptorConfiguration"},{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":27,"character":26},{"__symbolic":"reference","name":"any"}]}],"intercept":[{"__symbolic":"method"}],"acquireTokenInteractively":[{"__symbolic":"method"}],"getScopesForEndpoint":[{"__symbolic":"method"}],"matchResourcesToEndpoint":[{"__symbolic":"method"}],"getAbsoluteUrl":[{"__symbolic":"method"}],"matchScopesToEndpoint":[{"__symbolic":"method"}]}},"MsalInterceptorConfiguration":{"__symbolic":"interface"},"MsalInterceptorAuthRequest":{"__symbolic":"interface"},"ProtectedResourceScopes":{"__symbolic":"interface"},"MSAL_INSTANCE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":7,"character":33},"arguments":["MSAL_INSTANCE"]},"MSAL_GUARD_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":37},"arguments":["MSAL_GUARD_CONFIG"]},"MSAL_INTERCEPTOR_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":11,"character":43},"arguments":["MSAL_INTERCEPTOR_CONFIG"]},"MSAL_BROADCAST_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":13,"character":41},"arguments":["MSAL_BROADCAST_CONFIG"]},"MsalBroadcastService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":12,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":20,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INSTANCE"}]}],null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":22,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":22,"character":21},"arguments":[{"__symbolic":"reference","name":"MSAL_BROADCAST_CONFIG"}]}]],"parameters":[{"__symbolic":"reference","module":"@azure/msal-browser","name":"IPublicClientApplication","line":20,"character":53},{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","name":"MsalBroadcastConfiguration"}]}]}},"MsalBroadcastConfiguration":{"__symbolic":"interface"},"MsalModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":16,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"MsalRedirectComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":19,"character":8}],"providers":[{"__symbolic":"reference","name":"MsalGuard"},{"__symbolic":"reference","name":"MsalBroadcastService"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["msalInstance","guardConfig","interceptorConfig"],"value":{"ngModule":{"__symbolic":"reference","name":"MsalModule"},"providers":[{"provide":{"__symbolic":"reference","name":"MSAL_INSTANCE"},"useValue":{"__symbolic":"reference","name":"msalInstance"}},{"provide":{"__symbolic":"reference","name":"MSAL_GUARD_CONFIG"},"useValue":{"__symbolic":"reference","name":"guardConfig"}},{"provide":{"__symbolic":"reference","name":"MSAL_INTERCEPTOR_CONFIG"},"useValue":{"__symbolic":"reference","name":"interceptorConfig"}},{"__symbolic":"reference","name":"MsalService"}]}}}},"MsalRedirectComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":15,"character":1},"arguments":[{"selector":"app-redirect","template":""}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"MsalService"}]}],"ngOnInit":[{"__symbolic":"method"}]}},"MsalCustomNavigationClient":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@azure/msal-browser","name":"NavigationClient","line":17,"character":48},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","module":"@angular/router","name":"Router","line":21,"character":24},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":22,"character":26}]}],"navigateInternal":[{"__symbolic":"method"}]}},"version":"2.5.3"},"origins":{"MsalService":"./msal.service","IMsalService":"./IMsalService","MsalGuard":"./msal.guard","MsalGuardConfiguration":"./msal.guard.config","MsalGuardAuthRequest":"./msal.guard.config","MsalInterceptor":"./msal.interceptor","MsalInterceptorConfiguration":"./msal.interceptor.config","MsalInterceptorAuthRequest":"./msal.interceptor.config","ProtectedResourceScopes":"./msal.interceptor.config","MSAL_INSTANCE":"./constants","MSAL_GUARD_CONFIG":"./constants","MSAL_INTERCEPTOR_CONFIG":"./constants","MSAL_BROADCAST_CONFIG":"./constants","MsalBroadcastService":"./msal.broadcast.service","MsalBroadcastConfiguration":"./msal.broadcast.config","MsalModule":"./msal.module","MsalRedirectComponent":"./msal.redirect.component","MsalCustomNavigationClient":"./msal.navigation.client","version":"./packageMetadata"},"importAs":"@azure/msal-angular"}
{"__symbolic":"module","version":4,"metadata":{"MsalService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":24,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":30,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INSTANCE"}]}],null],"parameters":[{"__symbolic":"reference","module":"@azure/msal-browser","name":"IPublicClientApplication","line":30,"character":48},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":31,"character":26}]}],"initialize":[{"__symbolic":"method"}],"acquireTokenPopup":[{"__symbolic":"method"}],"acquireTokenRedirect":[{"__symbolic":"method"}],"acquireTokenSilent":[{"__symbolic":"method"}],"handleRedirectObservable":[{"__symbolic":"method"}],"loginPopup":[{"__symbolic":"method"}],"loginRedirect":[{"__symbolic":"method"}],"logout":[{"__symbolic":"method"}],"logoutRedirect":[{"__symbolic":"method"}],"logoutPopup":[{"__symbolic":"method"}],"ssoSilent":[{"__symbolic":"method"}],"getLogger":[{"__symbolic":"method"}],"setLogger":[{"__symbolic":"method"}]}},"IMsalService":{"__symbolic":"interface"},"MsalGuard":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":21,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_GUARD_CONFIG"}]}],null,null,null,null],"parameters":[{"__symbolic":"reference","name":"MsalGuardConfiguration"},{"__symbolic":"reference","name":"MsalBroadcastService"},{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":24,"character":26},{"__symbolic":"reference","module":"@angular/router","name":"Router","line":25,"character":24}]}],"parseUrl":[{"__symbolic":"method"}],"getDestinationUrl":[{"__symbolic":"method"}],"loginInteractively":[{"__symbolic":"method"}],"activateHelper":[{"__symbolic":"method"}],"includesCode":[{"__symbolic":"method"}],"canActivate":[{"__symbolic":"method"}],"canActivateChild":[{"__symbolic":"method"}],"canLoad":[{"__symbolic":"method"}]}},"MsalGuardConfiguration":{"__symbolic":"interface"},"MsalGuardAuthRequest":{"__symbolic":"interface"},"MsalInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":21,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":26,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INTERCEPTOR_CONFIG"}]}],null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":31,"character":9},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":31,"character":16}]}]],"parameters":[{"__symbolic":"reference","name":"MsalInterceptorConfiguration"},{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":28,"character":26},{"__symbolic":"reference","name":"MsalBroadcastService"},{"__symbolic":"reference","name":"any"}]}],"intercept":[{"__symbolic":"method"}],"acquireToken":[{"__symbolic":"method"}],"acquireTokenInteractively":[{"__symbolic":"method"}],"getScopesForEndpoint":[{"__symbolic":"method"}],"matchResourcesToEndpoint":[{"__symbolic":"method"}],"getAbsoluteUrl":[{"__symbolic":"method"}],"matchScopesToEndpoint":[{"__symbolic":"method"}]}},"MsalInterceptorConfiguration":{"__symbolic":"interface"},"MsalInterceptorAuthRequest":{"__symbolic":"interface"},"ProtectedResourceScopes":{"__symbolic":"interface"},"MSAL_INSTANCE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":7,"character":33},"arguments":["MSAL_INSTANCE"]},"MSAL_GUARD_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":37},"arguments":["MSAL_GUARD_CONFIG"]},"MSAL_INTERCEPTOR_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":11,"character":43},"arguments":["MSAL_INTERCEPTOR_CONFIG"]},"MSAL_BROADCAST_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":13,"character":41},"arguments":["MSAL_BROADCAST_CONFIG"]},"MsalBroadcastService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":12,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":20,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INSTANCE"}]}],null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":22,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":22,"character":21},"arguments":[{"__symbolic":"reference","name":"MSAL_BROADCAST_CONFIG"}]}]],"parameters":[{"__symbolic":"reference","module":"@azure/msal-browser","name":"IPublicClientApplication","line":20,"character":53},{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","name":"MsalBroadcastConfiguration"}]}]}},"MsalBroadcastConfiguration":{"__symbolic":"interface"},"MsalModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":16,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"MsalRedirectComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":19,"character":8}],"providers":[{"__symbolic":"reference","name":"MsalGuard"},{"__symbolic":"reference","name":"MsalBroadcastService"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["msalInstance","guardConfig","interceptorConfig"],"value":{"ngModule":{"__symbolic":"reference","name":"MsalModule"},"providers":[{"provide":{"__symbolic":"reference","name":"MSAL_INSTANCE"},"useValue":{"__symbolic":"reference","name":"msalInstance"}},{"provide":{"__symbolic":"reference","name":"MSAL_GUARD_CONFIG"},"useValue":{"__symbolic":"reference","name":"guardConfig"}},{"provide":{"__symbolic":"reference","name":"MSAL_INTERCEPTOR_CONFIG"},"useValue":{"__symbolic":"reference","name":"interceptorConfig"}},{"__symbolic":"reference","name":"MsalService"}]}}}},"MsalRedirectComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":15,"character":1},"arguments":[{"selector":"app-redirect","template":""}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"MsalService"}]}],"ngOnInit":[{"__symbolic":"method"}]}},"MsalCustomNavigationClient":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@azure/msal-browser","name":"NavigationClient","line":17,"character":48},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","module":"@angular/router","name":"Router","line":21,"character":24},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":22,"character":26}]}],"navigateInternal":[{"__symbolic":"method"}]}},"version":"2.5.4"},"origins":{"MsalService":"./msal.service","IMsalService":"./IMsalService","MsalGuard":"./msal.guard","MsalGuardConfiguration":"./msal.guard.config","MsalGuardAuthRequest":"./msal.guard.config","MsalInterceptor":"./msal.interceptor","MsalInterceptorConfiguration":"./msal.interceptor.config","MsalInterceptorAuthRequest":"./msal.interceptor.config","ProtectedResourceScopes":"./msal.interceptor.config","MSAL_INSTANCE":"./constants","MSAL_GUARD_CONFIG":"./constants","MSAL_INTERCEPTOR_CONFIG":"./constants","MSAL_BROADCAST_CONFIG":"./constants","MsalBroadcastService":"./msal.broadcast.service","MsalBroadcastConfiguration":"./msal.broadcast.config","MsalModule":"./msal.module","MsalRedirectComponent":"./msal.redirect.component","MsalCustomNavigationClient":"./msal.navigation.client","version":"./packageMetadata"},"importAs":"@azure/msal-angular"}

@@ -18,3 +18,3 @@ (function (global, factory) {

var name = "@azure/msal-angular";
var version = "2.5.3";
var version = "2.5.4";

@@ -324,3 +324,3 @@ /*

var MsalInterceptor = /** @class */ (function () {
function MsalInterceptor(msalInterceptorConfig, authService, location,
function MsalInterceptor(msalInterceptorConfig, authService, location, msalBroadcastService,
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types

@@ -331,2 +331,3 @@ document) {

this.location = location;
this.msalBroadcastService = msalBroadcastService;
this._document = document;

@@ -362,2 +363,20 @@ }

this.authService.getLogger().infoPii("Interceptor - [" + scopes + "] scopes found for " + req.url);
return this.acquireToken(authRequest, scopes, account)
.pipe(operators.switchMap(function (result) {
_this.authService.getLogger().verbose("Interceptor - setting authorization headers");
var headers = req.headers
.set("Authorization", "Bearer " + result.accessToken);
var requestClone = req.clone({ headers: headers });
return next.handle(requestClone);
}));
};
/**
* Try to acquire token silently. Invoke interaction if acquireTokenSilent rejected with error or resolved with null access token
* @param authRequest Request
* @param scopes Array of scopes for the request
* @param account Account
* @returns Authentication result
*/
MsalInterceptor.prototype.acquireToken = function (authRequest, scopes, account) {
var _this = this;
// Note: For MSA accounts, include openid scope when calling acquireTokenSilent to return idToken

@@ -367,15 +386,17 @@ return this.authService.acquireTokenSilent(Object.assign(Object.assign({}, authRequest), { scopes: scopes, account: account }))

_this.authService.getLogger().error("Interceptor - acquireTokenSilent rejected with error. Invoking interaction to resolve.");
return _this.acquireTokenInteractively(authRequest, scopes);
return _this.msalBroadcastService.inProgress$
.pipe(operators.take(1), operators.switchMap(function (status) {
if (status === msalBrowser.InteractionStatus.None) {
return _this.acquireTokenInteractively(authRequest, scopes);
}
return _this.msalBroadcastService.inProgress$
.pipe(operators.filter(function (status) { return status === msalBrowser.InteractionStatus.None; }), operators.take(1), operators.switchMap(function () { return _this.acquireToken(authRequest, scopes, account); }));
}));
}), operators.switchMap(function (result) {
if (!result.accessToken) {
_this.authService.getLogger().error("Interceptor - acquireTokenSilent resolved with null access token. Known issue with B2C tenants, invoking interaction to resolve.");
return _this.acquireTokenInteractively(authRequest, scopes);
return _this.msalBroadcastService.inProgress$
.pipe(operators.filter(function (status) { return status === msalBrowser.InteractionStatus.None; }), operators.take(1), operators.switchMap(function () { return _this.acquireTokenInteractively(authRequest, scopes); }));
}
return rxjs.of(result);
}), operators.switchMap(function (result) {
_this.authService.getLogger().verbose("Interceptor - setting authorization headers");
var headers = req.headers
.set("Authorization", "Bearer " + result.accessToken);
var requestClone = req.clone({ headers: headers });
return next.handle(requestClone);
}));

@@ -489,3 +510,3 @@ };

if (normalizedResourceMethod === normalizedRequestMethod) {
// Validate if scopes comes null to unprotect the resource in a certain http method
// Validate if scopes comes null to unprotect the resource in a certain http method
if (entry.scopes === null) {

@@ -525,2 +546,3 @@ allMatchedScopes.push(null);

{ type: common.Location },
{ type: MsalBroadcastService },
{ type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] }

@@ -665,2 +687,60 @@ ]; };

}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function")
throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn)
context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access)
context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done)
throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0)
continue;
if (result === null || typeof result !== "object")
throw new TypeError("Object expected");
if (_ = accept(result.get))
descriptor.get = _;
if (_ = accept(result.set))
descriptor.set = _;
if (_ = accept(result.init))
initializers.push(_);
}
else if (_ = accept(result)) {
if (kind === "field")
initializers.push(_);
else
descriptor[key] = _;
}
}
if (target)
Object.defineProperty(target, contextIn.name, descriptor);
done = true;
}
;
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
}
;
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
}
;
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol")
name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
}
;
function __metadata(metadataKey, metadataValue) {

@@ -697,3 +777,3 @@ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")

throw new TypeError("Generator is already executing.");
while (_)
while (g && (g = 0, op[0] && (_ = 0)), _)
try {

@@ -866,3 +946,3 @@ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)

return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}

@@ -869,0 +949,0 @@ function __asyncValues(o) {

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@azure/msal-browser"),require("rxjs"),require("@angular/router"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@azure/msal-angular",["exports","@angular/core","@angular/common","@azure/msal-browser","rxjs","@angular/router","rxjs/operators"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).azure=e.azure||{},e.azure["msal-angular"]={}),e.ng.core,e.ng.common,e["@azure/msal-browser"],e.rxjs,e.ng.router,e.rxjs.operators)}(this,(function(e,t,r,o,n,i,a){"use strict";var s=new t.InjectionToken("MSAL_INSTANCE"),c=new t.InjectionToken("MSAL_GUARD_CONFIG"),u=new t.InjectionToken("MSAL_INTERCEPTOR_CONFIG"),l=new t.InjectionToken("MSAL_BROADCAST_CONFIG"),p="@azure/msal-angular",g="2.5.3",h=function(){function e(e,t){this.instance=e,this.location=t;var r=this.location.path(!0).split("#").pop();r&&(this.redirectHash="#"+r),this.instance.initializeWrapperLibrary(o.WrapperSKU.Angular,g)}return e.prototype.initialize=function(){return n.from(this.instance.initialize())},e.prototype.acquireTokenPopup=function(e){return n.from(this.instance.acquireTokenPopup(e))},e.prototype.acquireTokenRedirect=function(e){return n.from(this.instance.acquireTokenRedirect(e))},e.prototype.acquireTokenSilent=function(e){return n.from(this.instance.acquireTokenSilent(e))},e.prototype.handleRedirectObservable=function(e){return n.from(this.instance.handleRedirectPromise(e||this.redirectHash))},e.prototype.loginPopup=function(e){return n.from(this.instance.loginPopup(e))},e.prototype.loginRedirect=function(e){return n.from(this.instance.loginRedirect(e))},e.prototype.logout=function(e){return n.from(this.instance.logout(e))},e.prototype.logoutRedirect=function(e){return n.from(this.instance.logoutRedirect(e))},e.prototype.logoutPopup=function(e){return n.from(this.instance.logoutPopup(e))},e.prototype.ssoSilent=function(e){return n.from(this.instance.ssoSilent(e))},e.prototype.getLogger=function(){return this.logger||(this.logger=this.instance.getLogger().clone(p,g)),this.logger},e.prototype.setLogger=function(e){this.logger=e.clone(p,g),this.instance.setLogger(e)},e}();h.decorators=[{type:t.Injectable}],h.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[s]}]},{type:r.Location}]};var v=function(e,t,r){var i=this;this.msalInstance=e,this.authService=t,this.msalBroadcastConfig=r,this.msalBroadcastConfig&&this.msalBroadcastConfig.eventsToReplay>0?(this.authService.getLogger().verbose("BroadcastService - replayPastEvents set on BroadcastConfig, replaying the last "+this.msalBroadcastConfig.eventsToReplay+" events"),this._msalSubject=new n.ReplaySubject(this.msalBroadcastConfig.eventsToReplay)):this._msalSubject=new n.Subject,this.msalSubject$=this._msalSubject.asObservable(),this._inProgress=new n.BehaviorSubject(o.InteractionStatus.Startup),this.inProgress$=this._inProgress.asObservable(),this.msalInstance.addEventCallback((function(e){i._msalSubject.next(e);var t=o.EventMessageUtils.getInteractionStatusFromEvent(e,i._inProgress.value);null!==t&&(i.authService.getLogger().verbose("BroadcastService - "+e.eventType+" results in setting inProgress from "+i._inProgress.value+" to "+t),i._inProgress.next(t))}))};v.decorators=[{type:t.Injectable}],v.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[s]}]},{type:h},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[l]}]}]};var d=function(){function e(e,t,r,o,n){this.msalGuardConfig=e,this.msalBroadcastService=t,this.authService=r,this.location=o,this.router=n,this.msalBroadcastService.inProgress$.subscribe()}return e.prototype.parseUrl=function(e){return this.router.parseUrl(e)},e.prototype.getDestinationUrl=function(e){this.authService.getLogger().verbose("Guard - getting destination url");var t=document.getElementsByTagName("base"),r=this.location.normalize(t.length?t[0].href:window.location.origin),o=this.location.prepareExternalUrl(e);return o.startsWith("#")?(this.authService.getLogger().verbose("Guard - destination by hash routing"),r+"/"+o):""+r+e},e.prototype.loginInteractively=function(e){var t=this,r="function"==typeof this.msalGuardConfig.authRequest?this.msalGuardConfig.authRequest(this.authService,e):Object.assign({},this.msalGuardConfig.authRequest);if(this.msalGuardConfig.interactionType===o.InteractionType.Popup)return this.authService.getLogger().verbose("Guard - logging in by popup"),this.authService.loginPopup(r).pipe(a.map((function(e){return t.authService.getLogger().verbose("Guard - login by popup successful, can activate, setting active account"),t.authService.instance.setActiveAccount(e.account),!0})));this.authService.getLogger().verbose("Guard - logging in by redirect");var n=this.getDestinationUrl(e.url);return this.authService.loginRedirect(Object.assign({redirectStartPage:n},r)).pipe(a.map((function(){return!1})))},e.prototype.activateHelper=function(e){var r=this;if(this.msalGuardConfig.interactionType!==o.InteractionType.Popup&&this.msalGuardConfig.interactionType!==o.InteractionType.Redirect)throw new o.BrowserConfigurationAuthError("invalid_interaction_type","Invalid interaction type provided to MSAL Guard. InteractionType.Popup or InteractionType.Redirect must be provided in the MsalGuardConfiguration");if(this.authService.getLogger().verbose("MSAL Guard activated"),"undefined"==typeof window)return this.authService.getLogger().info("Guard - window is undefined, MSAL does not support server-side token acquisition"),n.of(!0);if(o.UrlString.hashContainsKnownProperties(window.location.hash)&&o.BrowserUtils.isInIframe()&&!this.authService.instance.getConfiguration().system.allowRedirectInIframe)return this.authService.getLogger().warning("Guard - redirectUri set to page with MSAL Guard. It is recommended to not set redirectUri to a page that requires authentication."),n.of(!1);this.msalGuardConfig.loginFailedRoute&&(this.loginFailedRoute=this.parseUrl(this.msalGuardConfig.loginFailedRoute));var i=this.location.path(!0);return this.authService.handleRedirectObservable().pipe(a.concatMap((function(){if(!r.authService.instance.getAllAccounts().length)return e?(r.authService.getLogger().verbose("Guard - no accounts retrieved, log in required to activate"),r.loginInteractively(e)):(r.authService.getLogger().verbose("Guard - no accounts retrieved, no state, cannot load"),n.of(!1));if(r.authService.getLogger().verbose("Guard - at least 1 account exists, can activate or load"),e){var t=r.includesCode(e.url),o=!!e.root&&!!e.root.fragment&&r.includesCode("#"+e.root.fragment),a=0===r.location.prepareExternalUrl(e.url).indexOf("#");if(t&&(o||a))return r.authService.getLogger().info("Guard - Hash contains known code response, stopping navigation."),i.indexOf("#")>-1?n.of(r.parseUrl(r.location.path())):n.of(r.parseUrl(""))}return n.of(!0)})),a.catchError((function(o){return r.authService.getLogger().error("Guard - error while logging in, unable to activate"),r.authService.getLogger().errorPii("Guard - error: "+o.message),r.loginFailedRoute&&parseInt(t.VERSION.major,10)>9&&e?(r.authService.getLogger().verbose("Guard - loginFailedRoute set, redirecting"),n.of(r.loginFailedRoute)):n.of(!1)})))},e.prototype.includesCode=function(e){return e.lastIndexOf("/code")>-1&&e.lastIndexOf("/code")===e.length-"/code".length||e.indexOf("#code=")>-1||e.indexOf("&code=")>-1},e.prototype.canActivate=function(e,t){return this.authService.getLogger().verbose("Guard - canActivate"),this.activateHelper(t)},e.prototype.canActivateChild=function(e,t){return this.authService.getLogger().verbose("Guard - canActivateChild"),this.activateHelper(t)},e.prototype.canLoad=function(){return this.authService.getLogger().verbose("Guard - canLoad"),this.activateHelper()},e}();d.decorators=[{type:t.Injectable}],d.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[c]}]},{type:v},{type:h},{type:r.Location},{type:i.Router}]};var f=function(){function e(e,t,r,o){this.msalInterceptorConfig=e,this.authService=t,this.location=r,this._document=o}return e.prototype.intercept=function(e,t){var r=this;if(this.msalInterceptorConfig.interactionType!==o.InteractionType.Popup&&this.msalInterceptorConfig.interactionType!==o.InteractionType.Redirect)throw new o.BrowserConfigurationAuthError("invalid_interaction_type","Invalid interaction type provided to MSAL Interceptor. InteractionType.Popup, InteractionType.Redirect must be provided in the msalInterceptorConfiguration");this.authService.getLogger().verbose("MSAL Interceptor activated");var i,s=this.getScopesForEndpoint(e.url,e.method);if(!s||0===s.length)return this.authService.getLogger().verbose("Interceptor - no scopes for endpoint"),t.handle(e);this.authService.instance.getActiveAccount()?(this.authService.getLogger().verbose("Interceptor - active account selected"),i=this.authService.instance.getActiveAccount()):(this.authService.getLogger().verbose("Interceptor - no active account, fallback to first account"),i=this.authService.instance.getAllAccounts()[0]);var c="function"==typeof this.msalInterceptorConfig.authRequest?this.msalInterceptorConfig.authRequest(this.authService,e,{account:i}):Object.assign(Object.assign({},this.msalInterceptorConfig.authRequest),{account:i});return this.authService.getLogger().info("Interceptor - "+s.length+" scopes found for endpoint"),this.authService.getLogger().infoPii("Interceptor - ["+s+"] scopes found for "+e.url),this.authService.acquireTokenSilent(Object.assign(Object.assign({},c),{scopes:s,account:i})).pipe(a.catchError((function(){return r.authService.getLogger().error("Interceptor - acquireTokenSilent rejected with error. Invoking interaction to resolve."),r.acquireTokenInteractively(c,s)})),a.switchMap((function(e){return e.accessToken?n.of(e):(r.authService.getLogger().error("Interceptor - acquireTokenSilent resolved with null access token. Known issue with B2C tenants, invoking interaction to resolve."),r.acquireTokenInteractively(c,s))})),a.switchMap((function(o){r.authService.getLogger().verbose("Interceptor - setting authorization headers");var n=e.headers.set("Authorization","Bearer "+o.accessToken),i=e.clone({headers:n});return t.handle(i)})))},e.prototype.acquireTokenInteractively=function(e,t){if(this.msalInterceptorConfig.interactionType===o.InteractionType.Popup)return this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by popup"),this.authService.acquireTokenPopup(Object.assign(Object.assign({},e),{scopes:t}));this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by redirect");var r=window.location.href;return this.authService.acquireTokenRedirect(Object.assign(Object.assign({},e),{scopes:t,redirectStartPage:r})),n.EMPTY},e.prototype.getScopesForEndpoint=function(e,t){this.authService.getLogger().verbose("Interceptor - getting scopes for endpoint");var r=this.location.normalize(e),o=Array.from(this.msalInterceptorConfig.protectedResourceMap.keys()),n=this.matchResourcesToEndpoint(o,r);return n.absoluteResources.length>0?this.matchScopesToEndpoint(this.msalInterceptorConfig.protectedResourceMap,n.absoluteResources,t):n.relativeResources.length>0?this.matchScopesToEndpoint(this.msalInterceptorConfig.protectedResourceMap,n.relativeResources,t):null},e.prototype.matchResourcesToEndpoint=function(e,t){var r=this,n={absoluteResources:[],relativeResources:[]};return e.forEach((function(e){var i=r.location.normalize(e);o.StringUtils.matchPattern(i,t)&&n.absoluteResources.push(e);var a=r.getAbsoluteUrl(e),s=new o.UrlString(a).getUrlComponents(),c=r.getAbsoluteUrl(t),u=new o.UrlString(c).getUrlComponents(),l=s.QueryString?s.AbsolutePath+"?"+s.QueryString:r.location.normalize(s.AbsolutePath);s.HostNameAndPort===u.HostNameAndPort&&o.StringUtils.matchPattern(l,c)&&""!==l&&"/*"!==l&&n.relativeResources.push(e)})),n},e.prototype.getAbsoluteUrl=function(e){var t=this._document.createElement("a");return t.href=e,t.href},e.prototype.matchScopesToEndpoint=function(e,t,r){var o=[];return t.forEach((function(t){var n=[],i=e.get(t);null!==i?(i.forEach((function(e){if("string"==typeof e)n.push(e);else{var t=r.toLowerCase();e.httpMethod.toLowerCase()===t&&(null===e.scopes?o.push(null):e.scopes.forEach((function(e){n.push(e)})))}})),n.length>0&&o.push(n)):o.push(null)})),o.length>0?(o.length>1&&this.authService.getLogger().warning("Interceptor - More than 1 matching scopes for endpoint found."),o[0]):null},e}();f.decorators=[{type:t.Injectable}],f.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[u]}]},{type:h},{type:r.Location},{type:void 0,decorators:[{type:t.Inject,args:[r.DOCUMENT]}]}]};var y=function(){function e(e){this.authService=e}return e.prototype.ngOnInit=function(){var e=this;this.authService.getLogger().verbose("MsalRedirectComponent activated"),this.authService.initialize().pipe(a.concatMap((function(){return e.authService.handleRedirectObservable()}))).subscribe()},e}();y.decorators=[{type:t.Component,args:[{selector:"app-redirect",template:""}]}],y.ctorParameters=function(){return[{type:h}]};var m=function(){function e(){}return e.forRoot=function(t,r,o){return{ngModule:e,providers:[{provide:s,useValue:t},{provide:c,useValue:r},{provide:u,useValue:o},h]}},e}();m.decorators=[{type:t.NgModule,args:[{declarations:[y],imports:[r.CommonModule],providers:[d,v]}]}];var S=function(e,t){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function b(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function I(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;Object.create;var C=function(e){function t(t,r,o){var n=e.call(this)||this;return n.authService=t,n.router=r,n.location=o,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}S(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.navigateInternal=function(t,r){var n=Object.create(null,{navigateInternal:{get:function(){return e.prototype.navigateInternal}}});return b(this,void 0,void 0,(function(){var e,i;return I(this,(function(a){return this.authService.getLogger().trace("MsalCustomNavigationClient called"),this.authService.getLogger().verbose("MsalCustomNavigationClient - navigating"),this.authService.getLogger().verbosePii("MsalCustomNavigationClient - navigating to url: "+t),r.noHistory?[2,n.navigateInternal.call(this,t,r)]:(e=new o.UrlString(t).getUrlComponents(),i=e.QueryString?e.AbsolutePath+"?"+e.QueryString:this.location.normalize(e.AbsolutePath),this.router.navigateByUrl(i,{replaceUrl:r.noHistory}),[2,Promise.resolve(r.noHistory)])}))}))},t}(o.NavigationClient);C.decorators=[{type:t.Injectable}],C.ctorParameters=function(){return[{type:h},{type:i.Router},{type:r.Location}]},e.MSAL_BROADCAST_CONFIG=l,e.MSAL_GUARD_CONFIG=c,e.MSAL_INSTANCE=s,e.MSAL_INTERCEPTOR_CONFIG=u,e.MsalBroadcastService=v,e.MsalCustomNavigationClient=C,e.MsalGuard=d,e.MsalInterceptor=f,e.MsalModule=m,e.MsalRedirectComponent=y,e.MsalService=h,e.version=g,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@azure/msal-browser"),require("rxjs"),require("@angular/router"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@azure/msal-angular",["exports","@angular/core","@angular/common","@azure/msal-browser","rxjs","@angular/router","rxjs/operators"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).azure=e.azure||{},e.azure["msal-angular"]={}),e.ng.core,e.ng.common,e["@azure/msal-browser"],e.rxjs,e.ng.router,e.rxjs.operators)}(this,(function(e,t,r,o,n,i,a){"use strict";var s=new t.InjectionToken("MSAL_INSTANCE"),c=new t.InjectionToken("MSAL_GUARD_CONFIG"),u=new t.InjectionToken("MSAL_INTERCEPTOR_CONFIG"),l=new t.InjectionToken("MSAL_BROADCAST_CONFIG"),p="@azure/msal-angular",g="2.5.4",h=function(){function e(e,t){this.instance=e,this.location=t;var r=this.location.path(!0).split("#").pop();r&&(this.redirectHash="#"+r),this.instance.initializeWrapperLibrary(o.WrapperSKU.Angular,g)}return e.prototype.initialize=function(){return n.from(this.instance.initialize())},e.prototype.acquireTokenPopup=function(e){return n.from(this.instance.acquireTokenPopup(e))},e.prototype.acquireTokenRedirect=function(e){return n.from(this.instance.acquireTokenRedirect(e))},e.prototype.acquireTokenSilent=function(e){return n.from(this.instance.acquireTokenSilent(e))},e.prototype.handleRedirectObservable=function(e){return n.from(this.instance.handleRedirectPromise(e||this.redirectHash))},e.prototype.loginPopup=function(e){return n.from(this.instance.loginPopup(e))},e.prototype.loginRedirect=function(e){return n.from(this.instance.loginRedirect(e))},e.prototype.logout=function(e){return n.from(this.instance.logout(e))},e.prototype.logoutRedirect=function(e){return n.from(this.instance.logoutRedirect(e))},e.prototype.logoutPopup=function(e){return n.from(this.instance.logoutPopup(e))},e.prototype.ssoSilent=function(e){return n.from(this.instance.ssoSilent(e))},e.prototype.getLogger=function(){return this.logger||(this.logger=this.instance.getLogger().clone(p,g)),this.logger},e.prototype.setLogger=function(e){this.logger=e.clone(p,g),this.instance.setLogger(e)},e}();h.decorators=[{type:t.Injectable}],h.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[s]}]},{type:r.Location}]};var v=function(e,t,r){var i=this;this.msalInstance=e,this.authService=t,this.msalBroadcastConfig=r,this.msalBroadcastConfig&&this.msalBroadcastConfig.eventsToReplay>0?(this.authService.getLogger().verbose("BroadcastService - replayPastEvents set on BroadcastConfig, replaying the last "+this.msalBroadcastConfig.eventsToReplay+" events"),this._msalSubject=new n.ReplaySubject(this.msalBroadcastConfig.eventsToReplay)):this._msalSubject=new n.Subject,this.msalSubject$=this._msalSubject.asObservable(),this._inProgress=new n.BehaviorSubject(o.InteractionStatus.Startup),this.inProgress$=this._inProgress.asObservable(),this.msalInstance.addEventCallback((function(e){i._msalSubject.next(e);var t=o.EventMessageUtils.getInteractionStatusFromEvent(e,i._inProgress.value);null!==t&&(i.authService.getLogger().verbose("BroadcastService - "+e.eventType+" results in setting inProgress from "+i._inProgress.value+" to "+t),i._inProgress.next(t))}))};v.decorators=[{type:t.Injectable}],v.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[s]}]},{type:h},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[l]}]}]};var f=function(){function e(e,t,r,o,n){this.msalGuardConfig=e,this.msalBroadcastService=t,this.authService=r,this.location=o,this.router=n,this.msalBroadcastService.inProgress$.subscribe()}return e.prototype.parseUrl=function(e){return this.router.parseUrl(e)},e.prototype.getDestinationUrl=function(e){this.authService.getLogger().verbose("Guard - getting destination url");var t=document.getElementsByTagName("base"),r=this.location.normalize(t.length?t[0].href:window.location.origin),o=this.location.prepareExternalUrl(e);return o.startsWith("#")?(this.authService.getLogger().verbose("Guard - destination by hash routing"),r+"/"+o):""+r+e},e.prototype.loginInteractively=function(e){var t=this,r="function"==typeof this.msalGuardConfig.authRequest?this.msalGuardConfig.authRequest(this.authService,e):Object.assign({},this.msalGuardConfig.authRequest);if(this.msalGuardConfig.interactionType===o.InteractionType.Popup)return this.authService.getLogger().verbose("Guard - logging in by popup"),this.authService.loginPopup(r).pipe(a.map((function(e){return t.authService.getLogger().verbose("Guard - login by popup successful, can activate, setting active account"),t.authService.instance.setActiveAccount(e.account),!0})));this.authService.getLogger().verbose("Guard - logging in by redirect");var n=this.getDestinationUrl(e.url);return this.authService.loginRedirect(Object.assign({redirectStartPage:n},r)).pipe(a.map((function(){return!1})))},e.prototype.activateHelper=function(e){var r=this;if(this.msalGuardConfig.interactionType!==o.InteractionType.Popup&&this.msalGuardConfig.interactionType!==o.InteractionType.Redirect)throw new o.BrowserConfigurationAuthError("invalid_interaction_type","Invalid interaction type provided to MSAL Guard. InteractionType.Popup or InteractionType.Redirect must be provided in the MsalGuardConfiguration");if(this.authService.getLogger().verbose("MSAL Guard activated"),"undefined"==typeof window)return this.authService.getLogger().info("Guard - window is undefined, MSAL does not support server-side token acquisition"),n.of(!0);if(o.UrlString.hashContainsKnownProperties(window.location.hash)&&o.BrowserUtils.isInIframe()&&!this.authService.instance.getConfiguration().system.allowRedirectInIframe)return this.authService.getLogger().warning("Guard - redirectUri set to page with MSAL Guard. It is recommended to not set redirectUri to a page that requires authentication."),n.of(!1);this.msalGuardConfig.loginFailedRoute&&(this.loginFailedRoute=this.parseUrl(this.msalGuardConfig.loginFailedRoute));var i=this.location.path(!0);return this.authService.handleRedirectObservable().pipe(a.concatMap((function(){if(!r.authService.instance.getAllAccounts().length)return e?(r.authService.getLogger().verbose("Guard - no accounts retrieved, log in required to activate"),r.loginInteractively(e)):(r.authService.getLogger().verbose("Guard - no accounts retrieved, no state, cannot load"),n.of(!1));if(r.authService.getLogger().verbose("Guard - at least 1 account exists, can activate or load"),e){var t=r.includesCode(e.url),o=!!e.root&&!!e.root.fragment&&r.includesCode("#"+e.root.fragment),a=0===r.location.prepareExternalUrl(e.url).indexOf("#");if(t&&(o||a))return r.authService.getLogger().info("Guard - Hash contains known code response, stopping navigation."),i.indexOf("#")>-1?n.of(r.parseUrl(r.location.path())):n.of(r.parseUrl(""))}return n.of(!0)})),a.catchError((function(o){return r.authService.getLogger().error("Guard - error while logging in, unable to activate"),r.authService.getLogger().errorPii("Guard - error: "+o.message),r.loginFailedRoute&&parseInt(t.VERSION.major,10)>9&&e?(r.authService.getLogger().verbose("Guard - loginFailedRoute set, redirecting"),n.of(r.loginFailedRoute)):n.of(!1)})))},e.prototype.includesCode=function(e){return e.lastIndexOf("/code")>-1&&e.lastIndexOf("/code")===e.length-"/code".length||e.indexOf("#code=")>-1||e.indexOf("&code=")>-1},e.prototype.canActivate=function(e,t){return this.authService.getLogger().verbose("Guard - canActivate"),this.activateHelper(t)},e.prototype.canActivateChild=function(e,t){return this.authService.getLogger().verbose("Guard - canActivateChild"),this.activateHelper(t)},e.prototype.canLoad=function(){return this.authService.getLogger().verbose("Guard - canLoad"),this.activateHelper()},e}();f.decorators=[{type:t.Injectable}],f.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[c]}]},{type:v},{type:h},{type:r.Location},{type:i.Router}]};var d=function(){function e(e,t,r,o,n){this.msalInterceptorConfig=e,this.authService=t,this.location=r,this.msalBroadcastService=o,this._document=n}return e.prototype.intercept=function(e,t){var r=this;if(this.msalInterceptorConfig.interactionType!==o.InteractionType.Popup&&this.msalInterceptorConfig.interactionType!==o.InteractionType.Redirect)throw new o.BrowserConfigurationAuthError("invalid_interaction_type","Invalid interaction type provided to MSAL Interceptor. InteractionType.Popup, InteractionType.Redirect must be provided in the msalInterceptorConfiguration");this.authService.getLogger().verbose("MSAL Interceptor activated");var n,i=this.getScopesForEndpoint(e.url,e.method);if(!i||0===i.length)return this.authService.getLogger().verbose("Interceptor - no scopes for endpoint"),t.handle(e);this.authService.instance.getActiveAccount()?(this.authService.getLogger().verbose("Interceptor - active account selected"),n=this.authService.instance.getActiveAccount()):(this.authService.getLogger().verbose("Interceptor - no active account, fallback to first account"),n=this.authService.instance.getAllAccounts()[0]);var s="function"==typeof this.msalInterceptorConfig.authRequest?this.msalInterceptorConfig.authRequest(this.authService,e,{account:n}):Object.assign(Object.assign({},this.msalInterceptorConfig.authRequest),{account:n});return this.authService.getLogger().info("Interceptor - "+i.length+" scopes found for endpoint"),this.authService.getLogger().infoPii("Interceptor - ["+i+"] scopes found for "+e.url),this.acquireToken(s,i,n).pipe(a.switchMap((function(o){r.authService.getLogger().verbose("Interceptor - setting authorization headers");var n=e.headers.set("Authorization","Bearer "+o.accessToken),i=e.clone({headers:n});return t.handle(i)})))},e.prototype.acquireToken=function(e,t,r){var i=this;return this.authService.acquireTokenSilent(Object.assign(Object.assign({},e),{scopes:t,account:r})).pipe(a.catchError((function(){return i.authService.getLogger().error("Interceptor - acquireTokenSilent rejected with error. Invoking interaction to resolve."),i.msalBroadcastService.inProgress$.pipe(a.take(1),a.switchMap((function(n){return n===o.InteractionStatus.None?i.acquireTokenInteractively(e,t):i.msalBroadcastService.inProgress$.pipe(a.filter((function(e){return e===o.InteractionStatus.None})),a.take(1),a.switchMap((function(){return i.acquireToken(e,t,r)})))})))})),a.switchMap((function(r){return r.accessToken?n.of(r):(i.authService.getLogger().error("Interceptor - acquireTokenSilent resolved with null access token. Known issue with B2C tenants, invoking interaction to resolve."),i.msalBroadcastService.inProgress$.pipe(a.filter((function(e){return e===o.InteractionStatus.None})),a.take(1),a.switchMap((function(){return i.acquireTokenInteractively(e,t)}))))})))},e.prototype.acquireTokenInteractively=function(e,t){if(this.msalInterceptorConfig.interactionType===o.InteractionType.Popup)return this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by popup"),this.authService.acquireTokenPopup(Object.assign(Object.assign({},e),{scopes:t}));this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by redirect");var r=window.location.href;return this.authService.acquireTokenRedirect(Object.assign(Object.assign({},e),{scopes:t,redirectStartPage:r})),n.EMPTY},e.prototype.getScopesForEndpoint=function(e,t){this.authService.getLogger().verbose("Interceptor - getting scopes for endpoint");var r=this.location.normalize(e),o=Array.from(this.msalInterceptorConfig.protectedResourceMap.keys()),n=this.matchResourcesToEndpoint(o,r);return n.absoluteResources.length>0?this.matchScopesToEndpoint(this.msalInterceptorConfig.protectedResourceMap,n.absoluteResources,t):n.relativeResources.length>0?this.matchScopesToEndpoint(this.msalInterceptorConfig.protectedResourceMap,n.relativeResources,t):null},e.prototype.matchResourcesToEndpoint=function(e,t){var r=this,n={absoluteResources:[],relativeResources:[]};return e.forEach((function(e){var i=r.location.normalize(e);o.StringUtils.matchPattern(i,t)&&n.absoluteResources.push(e);var a=r.getAbsoluteUrl(e),s=new o.UrlString(a).getUrlComponents(),c=r.getAbsoluteUrl(t),u=new o.UrlString(c).getUrlComponents(),l=s.QueryString?s.AbsolutePath+"?"+s.QueryString:r.location.normalize(s.AbsolutePath);s.HostNameAndPort===u.HostNameAndPort&&o.StringUtils.matchPattern(l,c)&&""!==l&&"/*"!==l&&n.relativeResources.push(e)})),n},e.prototype.getAbsoluteUrl=function(e){var t=this._document.createElement("a");return t.href=e,t.href},e.prototype.matchScopesToEndpoint=function(e,t,r){var o=[];return t.forEach((function(t){var n=[],i=e.get(t);null!==i?(i.forEach((function(e){if("string"==typeof e)n.push(e);else{var t=r.toLowerCase();e.httpMethod.toLowerCase()===t&&(null===e.scopes?o.push(null):e.scopes.forEach((function(e){n.push(e)})))}})),n.length>0&&o.push(n)):o.push(null)})),o.length>0?(o.length>1&&this.authService.getLogger().warning("Interceptor - More than 1 matching scopes for endpoint found."),o[0]):null},e}();d.decorators=[{type:t.Injectable}],d.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[u]}]},{type:h},{type:r.Location},{type:v},{type:void 0,decorators:[{type:t.Inject,args:[r.DOCUMENT]}]}]};var y=function(){function e(e){this.authService=e}return e.prototype.ngOnInit=function(){var e=this;this.authService.getLogger().verbose("MsalRedirectComponent activated"),this.authService.initialize().pipe(a.concatMap((function(){return e.authService.handleRedirectObservable()}))).subscribe()},e}();y.decorators=[{type:t.Component,args:[{selector:"app-redirect",template:""}]}],y.ctorParameters=function(){return[{type:h}]};var S=function(){function e(){}return e.forRoot=function(t,r,o){return{ngModule:e,providers:[{provide:s,useValue:t},{provide:c,useValue:r},{provide:u,useValue:o},h]}},e}();S.decorators=[{type:t.NgModule,args:[{declarations:[y],imports:[r.CommonModule],providers:[f,v]}]}];var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function b(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function I(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}Object.create;Object.create;var C=function(e){function t(t,r,o){var n=e.call(this)||this;return n.authService=t,n.router=r,n.location=o,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.navigateInternal=function(t,r){var n=Object.create(null,{navigateInternal:{get:function(){return e.prototype.navigateInternal}}});return b(this,void 0,void 0,(function(){var e,i;return I(this,(function(a){return this.authService.getLogger().trace("MsalCustomNavigationClient called"),this.authService.getLogger().verbose("MsalCustomNavigationClient - navigating"),this.authService.getLogger().verbosePii("MsalCustomNavigationClient - navigating to url: "+t),r.noHistory?[2,n.navigateInternal.call(this,t,r)]:(e=new o.UrlString(t).getUrlComponents(),i=e.QueryString?e.AbsolutePath+"?"+e.QueryString:this.location.normalize(e.AbsolutePath),this.router.navigateByUrl(i,{replaceUrl:r.noHistory}),[2,Promise.resolve(r.noHistory)])}))}))},t}(o.NavigationClient);C.decorators=[{type:t.Injectable}],C.ctorParameters=function(){return[{type:h},{type:i.Router},{type:r.Location}]},e.MSAL_BROADCAST_CONFIG=l,e.MSAL_GUARD_CONFIG=c,e.MSAL_INSTANCE=s,e.MSAL_INTERCEPTOR_CONFIG=u,e.MsalBroadcastService=v,e.MsalCustomNavigationClient=C,e.MsalGuard=f,e.MsalInterceptor=d,e.MsalModule=S,e.MsalRedirectComponent=y,e.MsalService=h,e.version=g,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=azure-msal-angular.umd.min.js.map

@@ -7,9 +7,10 @@ /*

import { EMPTY, of } from "rxjs";
import { switchMap, catchError } from "rxjs/operators";
import { switchMap, catchError, take, filter } from "rxjs/operators";
import { MsalService } from "./msal.service";
import { BrowserConfigurationAuthError, InteractionType, StringUtils, UrlString } from "@azure/msal-browser";
import { BrowserConfigurationAuthError, InteractionStatus, InteractionType, StringUtils, UrlString } from "@azure/msal-browser";
import { Injectable, Inject } from "@angular/core";
import { MSAL_INTERCEPTOR_CONFIG } from "./constants";
import { MsalBroadcastService } from "./msal.broadcast.service";
export class MsalInterceptor {
constructor(msalInterceptorConfig, authService, location,
constructor(msalInterceptorConfig, authService, location, msalBroadcastService,
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types

@@ -20,2 +21,3 @@ document) {

this.location = location;
this.msalBroadcastService = msalBroadcastService;
this._document = document;

@@ -50,2 +52,19 @@ }

this.authService.getLogger().infoPii(`Interceptor - [${scopes}] scopes found for ${req.url}`);
return this.acquireToken(authRequest, scopes, account)
.pipe(switchMap((result) => {
this.authService.getLogger().verbose("Interceptor - setting authorization headers");
const headers = req.headers
.set("Authorization", `Bearer ${result.accessToken}`);
const requestClone = req.clone({ headers });
return next.handle(requestClone);
}));
}
/**
* Try to acquire token silently. Invoke interaction if acquireTokenSilent rejected with error or resolved with null access token
* @param authRequest Request
* @param scopes Array of scopes for the request
* @param account Account
* @returns Authentication result
*/
acquireToken(authRequest, scopes, account) {
// Note: For MSA accounts, include openid scope when calling acquireTokenSilent to return idToken

@@ -55,15 +74,17 @@ return this.authService.acquireTokenSilent(Object.assign(Object.assign({}, authRequest), { scopes, account }))

this.authService.getLogger().error("Interceptor - acquireTokenSilent rejected with error. Invoking interaction to resolve.");
return this.acquireTokenInteractively(authRequest, scopes);
return this.msalBroadcastService.inProgress$
.pipe(take(1), switchMap((status) => {
if (status === InteractionStatus.None) {
return this.acquireTokenInteractively(authRequest, scopes);
}
return this.msalBroadcastService.inProgress$
.pipe(filter((status) => status === InteractionStatus.None), take(1), switchMap(() => this.acquireToken(authRequest, scopes, account)));
}));
}), switchMap((result) => {
if (!result.accessToken) {
this.authService.getLogger().error("Interceptor - acquireTokenSilent resolved with null access token. Known issue with B2C tenants, invoking interaction to resolve.");
return this.acquireTokenInteractively(authRequest, scopes);
return this.msalBroadcastService.inProgress$
.pipe(filter((status) => status === InteractionStatus.None), take(1), switchMap(() => this.acquireTokenInteractively(authRequest, scopes)));
}
return of(result);
}), switchMap((result) => {
this.authService.getLogger().verbose("Interceptor - setting authorization headers");
const headers = req.headers
.set("Authorization", `Bearer ${result.accessToken}`);
const requestClone = req.clone({ headers });
return next.handle(requestClone);
}));

@@ -176,3 +197,3 @@ }

if (normalizedResourceMethod === normalizedRequestMethod) {
// Validate if scopes comes null to unprotect the resource in a certain http method
// Validate if scopes comes null to unprotect the resource in a certain http method
if (entry.scopes === null) {

@@ -211,4 +232,5 @@ allMatchedScopes.push(null);

{ type: Location },
{ type: MsalBroadcastService },
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNhbC5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tc2FsLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQVFILE9BQU8sRUFBRSxRQUFRLEVBQUUsUUFBUSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDckQsT0FBTyxFQUFjLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFDN0MsT0FBTyxFQUFFLFNBQVMsRUFBRSxVQUFVLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUN2RCxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDN0MsT0FBTyxFQUFxQyw2QkFBNkIsRUFBRSxlQUFlLEVBQUUsV0FBVyxFQUFFLFNBQVMsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ2hKLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ25ELE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUl0RCxNQUFNLE9BQU8sZUFBZTtJQUd4QixZQUM2QyxxQkFBbUQsRUFDcEYsV0FBd0IsRUFDeEIsUUFBa0I7SUFDMUIsaUhBQWlIO0lBQy9GLFFBQWM7UUFKUywwQkFBcUIsR0FBckIscUJBQXFCLEN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U2lsZW50IHJlc29sdmVkIHdpdGggbnVsbCBhY2Nlc3MgdG9rZW4uIEtub3duIGlzc3VlIHdpdGggQjJDIHRlbmFudHMsIGludm9raW5nIGludGVyYWN0aW9uIHRvIHJlc29sdmUuXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWNxdWlyZVRva2VuSW50ZXJhY3RpdmVseShhdXRoUmVxdWVzdCwgc2NvcGVzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2YocmVzdWx0KTtcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICBzd2l0Y2hNYXAoKHJlc3VsdDogQXV0aGVudGljYXRpb25SZXN1bHQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hdXRoU2VydmljZS5nZXRMb2dnZXIoKS52ZXJib3NlKFwiSW50ZXJjZXB0b3IgLSBzZXR0aW5nIGF1dGhvcml6YXRpb24gaGVhZGVyc1wiKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgaGVhZGVycyA9IHJlcS5oZWFkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2V0KFwiQXV0aG9yaXphdGlvblwiLCBgQmVhcmVyICR7cmVzdWx0LmFjY2Vzc1Rva2VufWApO1xuXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlcXVlc3RDbG9uZSA9IHJlcS5jbG9uZSh7aGVhZGVyc30pO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV4dC5oYW5kbGUocmVxdWVzdENsb25lKTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBJbnZva2UgaW50ZXJhY3Rpb24gZm9yIHRoZSBnaXZlbiBzZXQgb2Ygc2NvcGVzXG4gICAgICogQHBhcmFtIGF1dGhSZXF1ZXN0IFJlcXVlc3RcbiAgICAgKiBAcGFyY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RW5kcG9pbnQucHVzaChlbnRyeSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gRW5zdXJlIG1ldGhvZHMgYmVpbmcgY29tcGFyZWQgYXJlIG5vcm1hbGl6ZWRcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgbm9ybWFsaXplZFJlcXVlc3RNZXRob2QgPSBodHRwTWV0aG9kLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG5vcm1hbGl6ZWRSZXNvdXJjZU1ldGhvZCA9IGVudHJ5Lmh0dHBNZXRob2QudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gTWV0aG9kIGluIHByb3RlY3RlZFJlc291cmNlTWFwIG1hdGNoZXMgcmVxdWVzdCBodHRwIG1ldGhvZFxuICAgICAgICAgICAgICAgICAgICBpZiAobm9ybWFsaXplZFJlc291cmNlTWV0aG9kID09PSBub3JtYWxpemVkUmVxdWVzdE1ldGhvZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVmFsaWRhdGUgaWYgc2NvcGVzIGNvbWVzIG51bGwgdG8gdW5wcm90ZWN0IHRoZSByZXNvdXJjZSBpbiBhIGNlcnRhaW4gaHR0cCBtZXRob2QgXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW50cnkuc2NvcGVzID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsTWF0Y2hlZFNjb3Blcy5wdXNoKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeS5zY29wZXMuZm9yRWFjaCgoc2NvcGUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGVzRm9yRW5kcG9pbnQucHVzaChzY29wZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgLy8gT25seSBhZGQgdG8gYWxsIHNjb3BlcyBpZiBzY29wZXMgZm9yIGVuZHBvaW50IGFuZCBtZXRob2QgaXMgZm91bmRcbiAgICAgICAgICAgIGlmIChzY29wZXNGb3JFbmRwb2ludC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgYWxsTWF0Y2hlZFNjb3Blcy5wdXNoKHNjb3Blc0ZvckVuZHBvaW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKGFsbE1hdGNoZWRTY29wZXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgaWYgKGFsbE1hdGNoZWRTY29wZXMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgIHRoaXMuYXV0aFNlcnZpY2UuZ2V0TG9nZ2VyKCkud2FybmluZyhcIkludGVyY2VwdG9yIC0gTW9yZSB0aGFuIDEgbWF0Y2hpbmcgc2NvcGVzIGZvciBlbmRwb2ludCBmb3VuZC5cIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBSZXR1cm5zIHNjb3BlcyBmb3IgZmlyc3QgbWF0Y2hpbmcgZW5kcG9pbnRcbiAgICAgICAgICAgIHJldHVybiBhbGxNYXRjaGVkU2NvcGVzWzBdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG59XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNhbC5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tc2FsLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQV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EludGVyYWN0aW9uU3RhdHVzKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT09IEludGVyYWN0aW9uU3RhdHVzLk5vbmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmFjcXVpcmVUb2tlbkludGVyYWN0aXZlbHkoYXV0aFJlcXVlc3QsIHNjb3Blcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5tc2FsQnJvYWRjYXN0U2VydmljZS5pblByb2dyZXNzJFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnBpcGUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyKChzdGF0dXM6IEludGVyYWN0aW9uU3RhdHVzKSA9PiBzdGF0dXMgPT09IEludGVyYWN0aW9uU3RhdHVzLk5vbmUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRha2UoMSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoTWFwKCgpID0+IHRoaXMuYWNxdWlyZVRva2VuKGF1dGhSZXF1ZXN0LCBzY29wZXMsIGFjY291bnQpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICBzd2l0Y2hNYXAoKHJlc3VsdDogQXV0aGVudGljYXRpb25SZXN1bHQpICA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVzdWx0LmFjY2Vzc1Rva2VuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmF1dGhTZXJ2aWNlLmdldExvZ2dlcigpLmVycm9yKFwiSW50ZXJjZXB0b3IgLSBhY3F1aXJlVG9rZW5TaWxlbnQgcmVzb2x2ZWQgd2l0aCBudWxsIGFjY2VzcyB0b2tlbi4gS25vd24gaXNzdWUgd2l0aCBCMkMgdGVuYW50cywgaW52b2tpbmcgaW50ZXJhY3Rpb24gdG8gcmVzb2x2ZS5cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5tc2FsQnJvYWRjYXN0U2VydmljZS5pblByb2dyZXNzJFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5waXBlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWx0ZXIoKHN0YXR1czogSW50ZXJhY3Rpb25TdGF0dXMpID0+IHN0YXR1cyA9PT0gSW50ZXJhY3Rpb25TdGF0dXMuTm9uZSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRha2UoMSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaE1hcCgoKSA9PiB0aGlzLmFjcXVpcmVUb2tlbkludGVyYWN0aXZlbHkoYXV0aFJlcXVlc3QsIHNjb3BlcykpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2YocmVzdWx0KTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBJbnZva2UgaW50ZXJhY3Rpb24gZm9yIHRoZSBnaXZlbiBzZXQgb2Ygc2NvcGVzXG4gICAgICogQHBhcmFtIGF1dGhSZXF1ZXN0IFJlcXVlc3RcbiAgICAgKiBAcGFyYW0gc2NvcGVzIEFycmF5IG9mIHNjb3BlcyBmb3IgdGhlIHJlcXVlc3RcbiAgICAgKiBAcmV0dXJucyBSZXN1bHQgZnJvbSB0aGUgaW50ZXJhY3RpdmUgcmVxdWVz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tYWxpemVkXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG5vcm1hbGl6ZWRSZXF1ZXN0TWV0aG9kID0gaHR0cE1ldGhvZC50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBub3JtYWxpemVkUmVzb3VyY2VNZXRob2QgPSBlbnRyeS5odHRwTWV0aG9kLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIE1ldGhvZCBpbiBwcm90ZWN0ZWRSZXNvdXJjZU1hcCBtYXRjaGVzIHJlcXVlc3QgaHR0cCBtZXRob2RcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5vcm1hbGl6ZWRSZXNvdXJjZU1ldGhvZCA9PT0gbm9ybWFsaXplZFJlcXVlc3RNZXRob2QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFZhbGlkYXRlIGlmIHNjb3BlcyBjb21lcyBudWxsIHRvIHVucHJvdGVjdCB0aGUgcmVzb3VyY2UgaW4gYSBjZXJ0YWluIGh0dHAgbWV0aG9kXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW50cnkuc2NvcGVzID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsTWF0Y2hlZFNjb3Blcy5wdXNoKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeS5zY29wZXMuZm9yRWFjaCgoc2NvcGUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGVzRm9yRW5kcG9pbnQucHVzaChzY29wZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgLy8gT25seSBhZGQgdG8gYWxsIHNjb3BlcyBpZiBzY29wZXMgZm9yIGVuZHBvaW50IGFuZCBtZXRob2QgaXMgZm91bmRcbiAgICAgICAgICAgIGlmIChzY29wZXNGb3JFbmRwb2ludC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgYWxsTWF0Y2hlZFNjb3Blcy5wdXNoKHNjb3Blc0ZvckVuZHBvaW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKGFsbE1hdGNoZWRTY29wZXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgaWYgKGFsbE1hdGNoZWRTY29wZXMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgIHRoaXMuYXV0aFNlcnZpY2UuZ2V0TG9nZ2VyKCkud2FybmluZyhcIkludGVyY2VwdG9yIC0gTW9yZSB0aGFuIDEgbWF0Y2hpbmcgc2NvcGVzIGZvciBlbmRwb2ludCBmb3VuZC5cIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBSZXR1cm5zIHNjb3BlcyBmb3IgZmlyc3QgbWF0Y2hpbmcgZW5kcG9pbnRcbiAgICAgICAgICAgIHJldHVybiBhbGxNYXRjaGVkU2NvcGVzWzBdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG59XG4iXX0=
/* eslint-disable header/header */
export const name = "@azure/msal-angular";
export const version = "2.5.3";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZU1ldGFkYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3BhY2thZ2VNZXRhZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrQ0FBa0M7QUFDbEMsTUFBTSxDQUFDLE1BQU0sSUFBSSxHQUFHLHFCQUFxQixDQUFDO0FBQzFDLE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxPQUFPLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBoZWFkZXIvaGVhZGVyICovXG5leHBvcnQgY29uc3QgbmFtZSA9IFwiQGF6dXJlL21zYWwtYW5ndWxhclwiO1xuZXhwb3J0IGNvbnN0IHZlcnNpb24gPSBcIjIuNS4zXCI7XG4iXX0=
export const version = "2.5.4";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZU1ldGFkYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3BhY2thZ2VNZXRhZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrQ0FBa0M7QUFDbEMsTUFBTSxDQUFDLE1BQU0sSUFBSSxHQUFHLHFCQUFxQixDQUFDO0FBQzFDLE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxPQUFPLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBoZWFkZXIvaGVhZGVyICovXG5leHBvcnQgY29uc3QgbmFtZSA9IFwiQGF6dXJlL21zYWwtYW5ndWxhclwiO1xuZXhwb3J0IGNvbnN0IHZlcnNpb24gPSBcIjIuNS40XCI7XG4iXX0=

@@ -6,3 +6,3 @@ import { InjectionToken, Injectable, Inject, Optional, VERSION, Component, NgModule } from '@angular/core';

import { Router } from '@angular/router';
import { map, concatMap, catchError, switchMap } from 'rxjs/operators';
import { map, concatMap, catchError, switchMap, take, filter } from 'rxjs/operators';
import { __awaiter } from 'tslib';

@@ -21,3 +21,3 @@

const name = "@azure/msal-angular";
const version = "2.5.3";
const version = "2.5.4";

@@ -321,3 +321,3 @@ /*

class MsalInterceptor {
constructor(msalInterceptorConfig, authService, location,
constructor(msalInterceptorConfig, authService, location, msalBroadcastService,
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types

@@ -328,2 +328,3 @@ document) {

this.location = location;
this.msalBroadcastService = msalBroadcastService;
this._document = document;

@@ -358,2 +359,19 @@ }

this.authService.getLogger().infoPii(`Interceptor - [${scopes}] scopes found for ${req.url}`);
return this.acquireToken(authRequest, scopes, account)
.pipe(switchMap((result) => {
this.authService.getLogger().verbose("Interceptor - setting authorization headers");
const headers = req.headers
.set("Authorization", `Bearer ${result.accessToken}`);
const requestClone = req.clone({ headers });
return next.handle(requestClone);
}));
}
/**
* Try to acquire token silently. Invoke interaction if acquireTokenSilent rejected with error or resolved with null access token
* @param authRequest Request
* @param scopes Array of scopes for the request
* @param account Account
* @returns Authentication result
*/
acquireToken(authRequest, scopes, account) {
// Note: For MSA accounts, include openid scope when calling acquireTokenSilent to return idToken

@@ -363,15 +381,17 @@ return this.authService.acquireTokenSilent(Object.assign(Object.assign({}, authRequest), { scopes, account }))

this.authService.getLogger().error("Interceptor - acquireTokenSilent rejected with error. Invoking interaction to resolve.");
return this.acquireTokenInteractively(authRequest, scopes);
return this.msalBroadcastService.inProgress$
.pipe(take(1), switchMap((status) => {
if (status === InteractionStatus.None) {
return this.acquireTokenInteractively(authRequest, scopes);
}
return this.msalBroadcastService.inProgress$
.pipe(filter((status) => status === InteractionStatus.None), take(1), switchMap(() => this.acquireToken(authRequest, scopes, account)));
}));
}), switchMap((result) => {
if (!result.accessToken) {
this.authService.getLogger().error("Interceptor - acquireTokenSilent resolved with null access token. Known issue with B2C tenants, invoking interaction to resolve.");
return this.acquireTokenInteractively(authRequest, scopes);
return this.msalBroadcastService.inProgress$
.pipe(filter((status) => status === InteractionStatus.None), take(1), switchMap(() => this.acquireTokenInteractively(authRequest, scopes)));
}
return of(result);
}), switchMap((result) => {
this.authService.getLogger().verbose("Interceptor - setting authorization headers");
const headers = req.headers
.set("Authorization", `Bearer ${result.accessToken}`);
const requestClone = req.clone({ headers });
return next.handle(requestClone);
}));

@@ -484,3 +504,3 @@ }

if (normalizedResourceMethod === normalizedRequestMethod) {
// Validate if scopes comes null to unprotect the resource in a certain http method
// Validate if scopes comes null to unprotect the resource in a certain http method
if (entry.scopes === null) {

@@ -519,2 +539,3 @@ allMatchedScopes.push(null);

{ type: Location },
{ type: MsalBroadcastService },
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }

@@ -521,0 +542,0 @@ ];

@@ -6,2 +6,3 @@ import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from "@angular/common/http";

import { MsalInterceptorConfiguration } from "./msal.interceptor.config";
import { MsalBroadcastService } from "./msal.broadcast.service";
export declare class MsalInterceptor implements HttpInterceptor {

@@ -11,6 +12,15 @@ private msalInterceptorConfig;

private location;
private msalBroadcastService;
private _document?;
constructor(msalInterceptorConfig: MsalInterceptorConfiguration, authService: MsalService, location: Location, document?: any);
constructor(msalInterceptorConfig: MsalInterceptorConfiguration, authService: MsalService, location: Location, msalBroadcastService: MsalBroadcastService, document?: any);
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
/**
* Try to acquire token silently. Invoke interaction if acquireTokenSilent rejected with error or resolved with null access token
* @param authRequest Request
* @param scopes Array of scopes for the request
* @param account Account
* @returns Authentication result
*/
private acquireToken;
/**
* Invoke interaction for the given set of scopes

@@ -17,0 +27,0 @@ * @param authRequest Request

{
"name": "@azure/msal-angular",
"version": "2.5.3",
"version": "2.5.4",
"author": {

@@ -23,3 +23,3 @@ "name": "Microsoft",

"peerDependencies": {
"@azure/msal-browser": "^2.33.0",
"@azure/msal-browser": "^2.34.0",
"rxjs": "^6.0.0 || ^7.0.0"

@@ -26,0 +26,0 @@ },

export declare const name = "@azure/msal-angular";
export declare const version = "2.5.3";
export declare const version = "2.5.4";
//# sourceMappingURL=packageMetadata.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc