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.0.0-alpha.0 to 2.0.0-alpha.1

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":19,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":24,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INSTANCE"}]}],null],"parameters":[{"__symbolic":"reference","module":"@azure/msal-browser","name":"IPublicClientApplication","line":24,"character":48},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":25,"character":26}]}],"acquireTokenPopup":[{"__symbolic":"method"}],"acquireTokenRedirect":[{"__symbolic":"method"}],"acquireTokenSilent":[{"__symbolic":"method"}],"handleRedirectObservable":[{"__symbolic":"method"}],"loginPopup":[{"__symbolic":"method"}],"loginRedirect":[{"__symbolic":"method"}],"logout":[{"__symbolic":"method"}],"ssoSilent":[{"__symbolic":"method"}]}},"IMsalService":{"__symbolic":"interface"},"MsalGuard":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":15,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":18,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_GUARD_CONFIG"}]}],null,null],"parameters":[{"__symbolic":"reference","name":"MsalGuardConfiguration"},{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":20,"character":26}]}],"getDestinationUrl":[{"__symbolic":"method"}],"loginInteractively":[{"__symbolic":"method"}],"canActivate":[{"__symbolic":"method"}]}},"MsalGuardConfiguration":{"__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":23,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INTERCEPTOR_CONFIG"}]}],null],"parameters":[{"__symbolic":"reference","name":"MsalInterceptorConfiguration"},{"__symbolic":"reference","name":"MsalService"}]}],"intercept":[{"__symbolic":"method"}],"getScopesForEndpoint":[{"__symbolic":"method"}]}},"MsalInterceptorConfiguration":{"__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"]},"MsalBroadcastService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":10,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":16,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INSTANCE"}]}]],"parameters":[{"__symbolic":"reference","module":"@azure/msal-browser","name":"IPublicClientApplication","line":16,"character":53}]}]}},"MsalModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":15,"character":1},"arguments":[{"declarations":[],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":18,"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"}]}}}}},"origins":{"MsalService":"./msal.service","IMsalService":"./IMsalService","MsalGuard":"./msal.guard","MsalGuardConfiguration":"./msal.guard.config","MsalInterceptor":"./msal.interceptor","MsalInterceptorConfiguration":"./msal.interceptor.config","MSAL_INSTANCE":"./constants","MSAL_GUARD_CONFIG":"./constants","MSAL_INTERCEPTOR_CONFIG":"./constants","MsalBroadcastService":"./msal.broadcast.service","MsalModule":"./msal.module"},"importAs":"@azure/msal-angular"}
{"__symbolic":"module","version":4,"metadata":{"MsalService":{"__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":27,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INSTANCE"}]}],null],"parameters":[{"__symbolic":"reference","module":"@azure/msal-browser","name":"IPublicClientApplication","line":27,"character":48},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":28,"character":26}]}],"acquireTokenPopup":[{"__symbolic":"method"}],"acquireTokenRedirect":[{"__symbolic":"method"}],"acquireTokenSilent":[{"__symbolic":"method"}],"handleRedirectObservable":[{"__symbolic":"method"}],"loginPopup":[{"__symbolic":"method"}],"loginRedirect":[{"__symbolic":"method"}],"logout":[{"__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":15,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":18,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_GUARD_CONFIG"}]}],null,null],"parameters":[{"__symbolic":"reference","name":"MsalGuardConfiguration"},{"__symbolic":"reference","name":"MsalService"},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":20,"character":26}]}],"getDestinationUrl":[{"__symbolic":"method"}],"loginInteractively":[{"__symbolic":"method"}],"canActivate":[{"__symbolic":"method"}]}},"MsalGuardConfiguration":{"__symbolic":"interface"},"MsalInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":19,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":22,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INTERCEPTOR_CONFIG"}]}],null],"parameters":[{"__symbolic":"reference","name":"MsalInterceptorConfiguration"},{"__symbolic":"reference","name":"MsalService"}]}],"intercept":[{"__symbolic":"method"}],"getScopesForEndpoint":[{"__symbolic":"method"}]}},"MsalInterceptorConfiguration":{"__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"]},"MsalBroadcastService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":10,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":16,"character":9},"arguments":[{"__symbolic":"reference","name":"MSAL_INSTANCE"}]}]],"parameters":[{"__symbolic":"reference","module":"@azure/msal-browser","name":"IPublicClientApplication","line":16,"character":53}]}]}},"MsalModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":15,"character":1},"arguments":[{"declarations":[],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":18,"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"}]}}}}},"origins":{"MsalService":"./msal.service","IMsalService":"./IMsalService","MsalGuard":"./msal.guard","MsalGuardConfiguration":"./msal.guard.config","MsalInterceptor":"./msal.interceptor","MsalInterceptorConfiguration":"./msal.interceptor.config","MSAL_INSTANCE":"./constants","MSAL_GUARD_CONFIG":"./constants","MSAL_INTERCEPTOR_CONFIG":"./constants","MsalBroadcastService":"./msal.broadcast.service","MsalModule":"./msal.module"},"importAs":"@azure/msal-angular"}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs'), require('@azure/msal-browser'), require('rxjs/operators'), require('minimatch')) :
typeof define === 'function' && define.amd ? define('@azure/msal-angular', ['exports', '@angular/core', '@angular/common', 'rxjs', '@azure/msal-browser', 'rxjs/operators', 'minimatch'], factory) :
(global = global || self, factory((global.azure = global.azure || {}, global.azure['msal-angular'] = {}), global.ng.core, global.ng.common, global.rxjs, global['@azure/msal-browser'], global.rxjs.operators, global.minimatch));
}(this, (function (exports, core, common, rxjs, msalBrowser, operators, minimatch) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs'), require('@azure/msal-browser'), require('rxjs/operators')) :
typeof define === 'function' && define.amd ? define('@azure/msal-angular', ['exports', '@angular/core', '@angular/common', 'rxjs', '@azure/msal-browser', 'rxjs/operators'], factory) :
(global = global || self, factory((global.azure = global.azure || {}, global.azure['msal-angular'] = {}), global.ng.core, global.ng.common, global.rxjs, global['@azure/msal-browser'], global.rxjs.operators));
}(this, (function (exports, core, common, rxjs, msalBrowser, operators) { 'use strict';

@@ -14,2 +14,4 @@ /*

var MSAL_INTERCEPTOR_CONFIG = new core.InjectionToken("MSAL_INTERCEPTOR_CONFIG");
var name = "@azure/msal-angular";
var version = "2.0.0-alpha.0";

@@ -55,2 +57,12 @@ /*

};
MsalService.prototype.getLogger = function () {
if (!this.logger) {
this.logger = this.instance.getLogger().clone(name, version);
}
return this.logger;
};
MsalService.prototype.setLogger = function (logger) {
this.logger = logger.clone(name, version);
this.instance.setLogger(logger);
};
return MsalService;

@@ -82,2 +94,3 @@ }());

MsalGuard.prototype.getDestinationUrl = function (path) {
this.authService.getLogger().verbose("Guard - getting destination url");
// Absolute base url for the application (default to origin if base element not present)

@@ -90,2 +103,3 @@ var baseElements = document.getElementsByTagName("base");

if (pathUrl.startsWith("#")) {
this.authService.getLogger().verbose("Guard - destination by hash routing");
return baseUrl + "/" + pathUrl;

@@ -100,6 +114,12 @@ }

MsalGuard.prototype.loginInteractively = function (url) {
var _this = this;
if (this.msalGuardConfig.interactionType === msalBrowser.InteractionType.Popup) {
this.authService.getLogger().verbose("Guard - logging in by popup");
return this.authService.loginPopup(Object.assign({}, this.msalGuardConfig.authRequest))
.pipe(operators.map(function () { return true; }), operators.catchError(function () { return rxjs.of(false); }));
.pipe(operators.map(function () {
_this.authService.getLogger().verbose("Guard - login by popup successful, can activate");
return true;
}), operators.catchError(function () { return rxjs.of(false); }));
}
this.authService.getLogger().verbose("Guard - logging in by redirect");
var redirectStartPage = this.getDestinationUrl(url);

@@ -114,9 +134,24 @@ this.authService.loginRedirect(Object.assign({ redirectStartPage: redirectStartPage }, this.msalGuardConfig.authRequest));

}
this.authService.getLogger().verbose("MSAL Guard activated");
/*
* If a page with MSAL Guard is set as the redirect for acquireTokenSilent,
* short-circuit to prevent redirecting or popups.
* TODO: Update to allow running in iframe once allowRedirectInIframe is implemented
*/
if (msalBrowser.UrlString.hashContainsKnownProperties(window.location.hash) && msalBrowser.BrowserUtils.isInIframe()) {
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.");
return rxjs.of(false);
}
return this.authService.handleRedirectObservable()
.pipe(operators.concatMap(function () {
if (!_this.authService.instance.getAllAccounts().length) {
_this.authService.getLogger().verbose("Guard - no accounts retrieved, log in required to activate");
return _this.loginInteractively(state.url);
}
_this.authService.getLogger().verbose("Guard - account retrieved, can activate");
return rxjs.of(true);
}), operators.catchError(function () { return rxjs.of(false); }));
}), operators.catchError(function () {
_this.authService.getLogger().verbose("Guard - error while logging in, unable to activate");
return rxjs.of(false);
}));
};

@@ -146,7 +181,9 @@ return MsalGuard;

if (this.msalInterceptorConfig.interactionType !== msalBrowser.InteractionType.Popup && this.msalInterceptorConfig.interactionType !== msalBrowser.InteractionType.Redirect) {
throw new msalBrowser.BrowserConfigurationAuthError("invalid_interaction_type", "Invalid interaction type provided to MSAL Interceptor. InteractionType.Popup, InteractionType.Redirect or InteractionType.Silent must be provided in the msalInterceptorConfiguration");
throw new msalBrowser.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 scopes = this.getScopesForEndpoint(req.url);
var account = this.authService.instance.getAllAccounts()[0];
if (!scopes || scopes.length === 0) {
this.authService.getLogger().verbose("Interceptor - no scopes for endpoint");
return next.handle(req);

@@ -158,4 +195,6 @@ }

if (_this.msalInterceptorConfig.interactionType === msalBrowser.InteractionType.Popup) {
_this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by popup");
return _this.authService.acquireTokenPopup(Object.assign(Object.assign({}, _this.msalInterceptorConfig.authRequest), { scopes: scopes }));
}
_this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by redirect");
var redirectStartPage = window.location.href;

@@ -165,2 +204,3 @@ _this.authService.acquireTokenRedirect(Object.assign(Object.assign({}, _this.msalInterceptorConfig.authRequest), { scopes: scopes, redirectStartPage: redirectStartPage }));

}), operators.switchMap(function (result) {
_this.authService.getLogger().verbose("Interceptor - setting authorization headers");
var headers = req.headers

@@ -173,6 +213,6 @@ .set("Authorization", "Bearer " + result.accessToken);

MsalInterceptor.prototype.getScopesForEndpoint = function (endpoint) {
this.authService.getLogger().verbose("Interceptor - getting scopes for endpoint");
var protectedResourcesArray = Array.from(this.msalInterceptorConfig.protectedResourceMap.keys());
var keyMatchesEndpointArray = protectedResourcesArray.filter(function (key) {
var minimatch$1 = new minimatch.Minimatch(key);
return minimatch$1.match(endpoint) || endpoint.indexOf(key) > -1;
return msalBrowser.StringUtils.matchPattern(key, endpoint);
});

@@ -179,0 +219,0 @@ // process all protected resources and send the first matched resource

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("@azure/msal-browser"),require("rxjs/operators"),require("minimatch")):"function"==typeof define&&define.amd?define("@azure/msal-angular",["exports","@angular/core","@angular/common","rxjs","@azure/msal-browser","rxjs/operators","minimatch"],t):t(((e=e||self).azure=e.azure||{},e.azure["msal-angular"]={}),e.ng.core,e.ng.common,e.rxjs,e["@azure/msal-browser"],e.rxjs.operators,e.minimatch)}(this,(function(e,t,r,n,o,i,a){"use strict";var c=new t.InjectionToken("MSAL_INSTANCE"),s=new t.InjectionToken("MSAL_GUARD_CONFIG"),u=new t.InjectionToken("MSAL_INTERCEPTOR_CONFIG"),p=function(){function e(e,t){this.instance=e,this.location=t;var r=this.location.path(!0).split("#").pop();r&&(this.redirectHash="#"+r)}return 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(){var e=n.from(this.instance.handleRedirectPromise(this.redirectHash));return this.redirectHash="",e},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.ssoSilent=function(e){return n.from(this.instance.ssoSilent(e))},e}();p.decorators=[{type:t.Injectable}],p.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[c]}]},{type:r.Location}]};var l=function(){function e(e,t,r){this.msalGuardConfig=e,this.authService=t,this.location=r}return e.prototype.getDestinationUrl=function(e){var t=document.getElementsByTagName("base"),r=this.location.normalize(t.length?t[0].href:window.location.origin),n=this.location.prepareExternalUrl(e);return n.startsWith("#")?r+"/"+n:""+r+e},e.prototype.loginInteractively=function(e){if(this.msalGuardConfig.interactionType===o.InteractionType.Popup)return this.authService.loginPopup(Object.assign({},this.msalGuardConfig.authRequest)).pipe(i.map((function(){return!0})),i.catchError((function(){return n.of(!1)})));var t=this.getDestinationUrl(e);return this.authService.loginRedirect(Object.assign({redirectStartPage:t},this.msalGuardConfig.authRequest)),n.of(!1)},e.prototype.canActivate=function(e,t){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");return this.authService.handleRedirectObservable().pipe(i.concatMap((function(){return r.authService.instance.getAllAccounts().length?n.of(!0):r.loginInteractively(t.url)})),i.catchError((function(){return n.of(!1)})))},e}();l.decorators=[{type:t.Injectable}],l.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[s]}]},{type:p},{type:r.Location}]};var h=function(){function e(e,t){this.msalInterceptorConfig=e,this.authService=t}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 or InteractionType.Silent must be provided in the msalInterceptorConfiguration");var a=this.getScopesForEndpoint(e.url),c=this.authService.instance.getAllAccounts()[0];return a&&0!==a.length?this.authService.acquireTokenSilent(Object.assign(Object.assign({},this.msalInterceptorConfig.authRequest),{scopes:a,account:c})).pipe(i.catchError((function(){if(r.msalInterceptorConfig.interactionType===o.InteractionType.Popup)return r.authService.acquireTokenPopup(Object.assign(Object.assign({},r.msalInterceptorConfig.authRequest),{scopes:a}));var e=window.location.href;return r.authService.acquireTokenRedirect(Object.assign(Object.assign({},r.msalInterceptorConfig.authRequest),{scopes:a,redirectStartPage:e})),n.EMPTY})),i.switchMap((function(r){var n=e.headers.set("Authorization","Bearer "+r.accessToken),o=e.clone({headers:n});return t.handle(o)}))):t.handle(e)},e.prototype.getScopesForEndpoint=function(e){var t=Array.from(this.msalInterceptorConfig.protectedResourceMap.keys()).filter((function(t){return new a.Minimatch(t).match(e)||e.indexOf(t)>-1}));if(t.length>0){var r=t[0];if(r)return this.msalInterceptorConfig.protectedResourceMap.get(r)}return null},e}();h.decorators=[{type:t.Injectable}],h.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[u]}]},{type:p}]};var f=function(e){var t=this;this.msalInstance=e,this._msalSubject=new n.Subject,this.msalSubject$=this._msalSubject.asObservable(),this.msalInstance.addEventCallback((function(e){t._msalSubject.next(e)}))};f.decorators=[{type:t.Injectable}],f.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[c]}]}]};var d=function(){function e(){}return e.forRoot=function(t,r,n){return{ngModule:e,providers:[{provide:c,useValue:t},{provide:s,useValue:r},{provide:u,useValue:n},p]}},e}();d.decorators=[{type:t.NgModule,args:[{declarations:[],imports:[r.CommonModule],providers:[l,f]}]}],e.MSAL_GUARD_CONFIG=s,e.MSAL_INSTANCE=c,e.MSAL_INTERCEPTOR_CONFIG=u,e.MsalBroadcastService=f,e.MsalGuard=l,e.MsalInterceptor=h,e.MsalModule=d,e.MsalService=p,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("@azure/msal-browser"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@azure/msal-angular",["exports","@angular/core","@angular/common","rxjs","@azure/msal-browser","rxjs/operators"],t):t(((e=e||self).azure=e.azure||{},e.azure["msal-angular"]={}),e.ng.core,e.ng.common,e.rxjs,e["@azure/msal-browser"],e.rxjs.operators)}(this,(function(e,t,r,n,o,i){"use strict";var a=new t.InjectionToken("MSAL_INSTANCE"),c=new t.InjectionToken("MSAL_GUARD_CONFIG"),s=new t.InjectionToken("MSAL_INTERCEPTOR_CONFIG"),u="@azure/msal-angular",p="2.0.0-alpha.0",g=function(){function e(e,t){this.instance=e,this.location=t;var r=this.location.path(!0).split("#").pop();r&&(this.redirectHash="#"+r)}return 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(){var e=n.from(this.instance.handleRedirectPromise(this.redirectHash));return this.redirectHash="",e},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.ssoSilent=function(e){return n.from(this.instance.ssoSilent(e))},e.prototype.getLogger=function(){return this.logger||(this.logger=this.instance.getLogger().clone(u,p)),this.logger},e.prototype.setLogger=function(e){this.logger=e.clone(u,p),this.instance.setLogger(e)},e}();g.decorators=[{type:t.Injectable}],g.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[a]}]},{type:r.Location}]};var l=function(){function e(e,t,r){this.msalGuardConfig=e,this.authService=t,this.location=r}return 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),n=this.location.prepareExternalUrl(e);return n.startsWith("#")?(this.authService.getLogger().verbose("Guard - destination by hash routing"),r+"/"+n):""+r+e},e.prototype.loginInteractively=function(e){var t=this;if(this.msalGuardConfig.interactionType===o.InteractionType.Popup)return this.authService.getLogger().verbose("Guard - logging in by popup"),this.authService.loginPopup(Object.assign({},this.msalGuardConfig.authRequest)).pipe(i.map((function(){return t.authService.getLogger().verbose("Guard - login by popup successful, can activate"),!0})),i.catchError((function(){return n.of(!1)})));this.authService.getLogger().verbose("Guard - logging in by redirect");var r=this.getDestinationUrl(e);return this.authService.loginRedirect(Object.assign({redirectStartPage:r},this.msalGuardConfig.authRequest)),n.of(!1)},e.prototype.canActivate=function(e,t){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");return this.authService.getLogger().verbose("MSAL Guard activated"),o.UrlString.hashContainsKnownProperties(window.location.hash)&&o.BrowserUtils.isInIframe()?(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.authService.handleRedirectObservable().pipe(i.concatMap((function(){return r.authService.instance.getAllAccounts().length?(r.authService.getLogger().verbose("Guard - account retrieved, can activate"),n.of(!0)):(r.authService.getLogger().verbose("Guard - no accounts retrieved, log in required to activate"),r.loginInteractively(t.url))})),i.catchError((function(){return r.authService.getLogger().verbose("Guard - error while logging in, unable to activate"),n.of(!1)})))},e}();l.decorators=[{type:t.Injectable}],l.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[c]}]},{type:g},{type:r.Location}]};var h=function(){function e(e,t){this.msalInterceptorConfig=e,this.authService=t}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 a=this.getScopesForEndpoint(e.url),c=this.authService.instance.getAllAccounts()[0];return a&&0!==a.length?this.authService.acquireTokenSilent(Object.assign(Object.assign({},this.msalInterceptorConfig.authRequest),{scopes:a,account:c})).pipe(i.catchError((function(){if(r.msalInterceptorConfig.interactionType===o.InteractionType.Popup)return r.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by popup"),r.authService.acquireTokenPopup(Object.assign(Object.assign({},r.msalInterceptorConfig.authRequest),{scopes:a}));r.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by redirect");var e=window.location.href;return r.authService.acquireTokenRedirect(Object.assign(Object.assign({},r.msalInterceptorConfig.authRequest),{scopes:a,redirectStartPage:e})),n.EMPTY})),i.switchMap((function(n){r.authService.getLogger().verbose("Interceptor - setting authorization headers");var o=e.headers.set("Authorization","Bearer "+n.accessToken),i=e.clone({headers:o});return t.handle(i)}))):(this.authService.getLogger().verbose("Interceptor - no scopes for endpoint"),t.handle(e))},e.prototype.getScopesForEndpoint=function(e){this.authService.getLogger().verbose("Interceptor - getting scopes for endpoint");var t=Array.from(this.msalInterceptorConfig.protectedResourceMap.keys()).filter((function(t){return o.StringUtils.matchPattern(t,e)}));if(t.length>0){var r=t[0];if(r)return this.msalInterceptorConfig.protectedResourceMap.get(r)}return null},e}();h.decorators=[{type:t.Injectable}],h.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[s]}]},{type:g}]};var d=function(e){var t=this;this.msalInstance=e,this._msalSubject=new n.Subject,this.msalSubject$=this._msalSubject.asObservable(),this.msalInstance.addEventCallback((function(e){t._msalSubject.next(e)}))};d.decorators=[{type:t.Injectable}],d.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[a]}]}]};var f=function(){function e(){}return e.forRoot=function(t,r,n){return{ngModule:e,providers:[{provide:a,useValue:t},{provide:c,useValue:r},{provide:s,useValue:n},g]}},e}();f.decorators=[{type:t.NgModule,args:[{declarations:[],imports:[r.CommonModule],providers:[l,d]}]}],e.MSAL_GUARD_CONFIG=c,e.MSAL_INSTANCE=a,e.MSAL_INTERCEPTOR_CONFIG=s,e.MsalBroadcastService=d,e.MsalGuard=l,e.MsalInterceptor=h,e.MsalModule=f,e.MsalService=g,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=azure-msal-angular.umd.min.js.map
# Change Log - @azure/msal-angular
This log was last generated on Wed, 11 Nov 2020 23:33:20 GMT and should not be manually modified.
This log was last generated on Mon, 07 Dec 2020 23:02:52 GMT and should not be manually modified.
<!-- Start content -->
## 2.0.0-alpha.1
Mon, 07 Dec 2020 23:02:52 GMT
### Changes
- MSAL Angular v2 alpha.1 changes (janutter@microsoft.com)
## 2.0.0-alpha.0
Thu, 12 Nov 2020 00:45:30 GMT
### Changes
- Add msal-angular-v2-alpha-0 (#2463) (joarroyo@microsoft.com)
## 1.1.2

@@ -8,0 +24,0 @@

@@ -5,1 +5,3 @@ import { InjectionToken } from "@angular/core";

export declare const MSAL_INTERCEPTOR_CONFIG: InjectionToken<string>;
export declare const name = "@azure/msal-angular";
export declare const version = "2.0.0-alpha.0";

@@ -9,2 +9,4 @@ /*

export const MSAL_INTERCEPTOR_CONFIG = new InjectionToken("MSAL_INTERCEPTOR_CONFIG");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IkM6L1VzZXJzL2phbnV0dGVyL0NvZGUvbWljcm9zb2Z0LWF1dGhlbnRpY2F0aW9uLWxpYnJhcnktZm9yLWpzL2xpYi9tc2FsLWFuZ3VsYXIvc3JjLyIsInNvdXJjZXMiOlsiY29uc3RhbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUVILE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFL0MsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLElBQUksY0FBYyxDQUFTLGVBQWUsQ0FBQyxDQUFDO0FBRXpFLE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLElBQUksY0FBYyxDQUFTLG1CQUFtQixDQUFDLENBQUM7QUFFakYsTUFBTSxDQUFDLE1BQU0sdUJBQXVCLEdBQUcsSUFBSSxjQUFjLENBQVMseUJBQXlCLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXHJcbiAqIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLiBBbGwgcmlnaHRzIHJlc2VydmVkLlxyXG4gKiBMaWNlbnNlZCB1bmRlciB0aGUgTUlUIExpY2Vuc2UuXHJcbiAqL1xyXG5cclxuaW1wb3J0IHsgSW5qZWN0aW9uVG9rZW4gfSBmcm9tIFwiQGFuZ3VsYXIvY29yZVwiO1xyXG5cclxuZXhwb3J0IGNvbnN0IE1TQUxfSU5TVEFOQ0UgPSBuZXcgSW5qZWN0aW9uVG9rZW48c3RyaW5nPihcIk1TQUxfSU5TVEFOQ0VcIik7XHJcblxyXG5leHBvcnQgY29uc3QgTVNBTF9HVUFSRF9DT05GSUcgPSBuZXcgSW5qZWN0aW9uVG9rZW48c3RyaW5nPihcIk1TQUxfR1VBUkRfQ09ORklHXCIpO1xyXG5cclxuZXhwb3J0IGNvbnN0IE1TQUxfSU5URVJDRVBUT1JfQ09ORklHID0gbmV3IEluamVjdGlvblRva2VuPHN0cmluZz4oXCJNU0FMX0lOVEVSQ0VQVE9SX0NPTkZJR1wiKTtcclxuIl19
export const name = "@azure/msal-angular";
export const version = "2.0.0-alpha.0";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IkM6L1VzZXJzL2phbnV0dGVyL0NvZGUvbWljcm9zb2Z0LWF1dGhlbnRpY2F0aW9uL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JzZXJ2YWJsZTxBdXRoZW50aWNhdGlvblJlc3VsdCB8IG51bGw+O1xyXG4gICAgbG9naW5Qb3B1cChyZXF1ZXN0PzogUG9wdXBSZXF1ZXN0KTogT2JzZXJ2YWJsZTxBdXRoZW50aWNhdGlvblJlc3VsdD47XHJcbiAgICBsb2dpblJlZGlyZWN0KHJlcXVlc3Q/OiBSZWRpcmVjdFJlcXVlc3QpOiBPYnNlcnZhYmxlPHZvaWQ+O1xyXG4gICAgbG9nb3V0KGxvZ291dFJlcXVlc3Q/OiBFbmRTZXNzaW9uUmVxdWVzdCk6IE9ic2VydmFibGU8dm9pZD47XHJcbiAgICBzc29TaWxlbnQocmVxdWVzdDogQXV0aG9yaXphdGlvblVybFJlcXVlc3QpOiBPYnNlcnZhYmxlPEF1dGhlbnRpY2F0aW9uUmVzdWx0PjtcclxuICAgIGdldExvZ2dlcigpOiBMb2dnZXI7XHJcbiAgICBzZXRMb2dnZXIobG9nZ2VyOiBMb2dnZXIpOiB2b2lkO1xyXG59XHJcbiJdfQ==

@@ -8,3 +8,3 @@ /*

import { Location } from "@angular/common";
import { InteractionType, BrowserConfigurationAuthError } from "@azure/msal-browser";
import { InteractionType, BrowserConfigurationAuthError, BrowserUtils, UrlString } from "@azure/msal-browser";
import { MSAL_GUARD_CONFIG } from "./constants";

@@ -25,2 +25,3 @@ import { concatMap, catchError, map } from "rxjs/operators";

getDestinationUrl(path) {
this.authService.getLogger().verbose("Guard - getting destination url");
// Absolute base url for the application (default to origin if base element not present)

@@ -33,2 +34,3 @@ const baseElements = document.getElementsByTagName("base");

if (pathUrl.startsWith("#")) {
this.authService.getLogger().verbose("Guard - destination by hash routing");
return `${baseUrl}/${pathUrl}`;

@@ -44,5 +46,10 @@ }

if (this.msalGuardConfig.interactionType === InteractionType.Popup) {
this.authService.getLogger().verbose("Guard - logging in by popup");
return this.authService.loginPopup(Object.assign({}, this.msalGuardConfig.authRequest))
.pipe(map(() => true), catchError(() => of(false)));
.pipe(map(() => {
this.authService.getLogger().verbose("Guard - login by popup successful, can activate");
return true;
}), catchError(() => of(false)));
}
this.authService.getLogger().verbose("Guard - logging in by redirect");
const redirectStartPage = this.getDestinationUrl(url);

@@ -56,9 +63,24 @@ this.authService.loginRedirect(Object.assign({ redirectStartPage }, this.msalGuardConfig.authRequest));

}
this.authService.getLogger().verbose("MSAL Guard activated");
/*
* If a page with MSAL Guard is set as the redirect for acquireTokenSilent,
* short-circuit to prevent redirecting or popups.
* TODO: Update to allow running in iframe once allowRedirectInIframe is implemented
*/
if (UrlString.hashContainsKnownProperties(window.location.hash) && BrowserUtils.isInIframe()) {
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.");
return of(false);
}
return this.authService.handleRedirectObservable()
.pipe(concatMap(() => {
if (!this.authService.instance.getAllAccounts().length) {
this.authService.getLogger().verbose("Guard - no accounts retrieved, log in required to activate");
return this.loginInteractively(state.url);
}
this.authService.getLogger().verbose("Guard - account retrieved, can activate");
return of(true);
}), catchError(() => of(false)));
}), catchError(() => {
this.authService.getLogger().verbose("Guard - error while logging in, unable to activate");
return of(false);
}));
}

@@ -74,2 +96,2 @@ }

];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNhbC5ndWFyZC5qcyIsInNvdXJjZVJvb3QiOiJDOi9Vc2Vycy9qYW51dHRlci9Db2RlL21pY3Jvc29mdC1hdXRoZW50aWNhdGlvbi1saWJyYXJ5LWZvci1qcy9saWIvbXNhbC1hbmd1bGFyL3NyYy8iLCJzb3VyY2VzIjpbIm1zYWwuZ3VhcmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHO0FBR0gsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzdDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ25ELE9BQU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gICAgICAgICAgICAgcmV0dXJuIHRoaXMubG9naW5JbnRlcmFjdGl2ZWx5KHN0YXRlLnVybCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYXV0aFNlcnZpY2UuZ2V0TG9nZ2VyKCkudmVyYm9zZShcIkd1YXJkIC0gYWNjb3VudCByZXRyaWV2ZWQsIGNhbiBhY3RpdmF0ZVwiKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2YodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICB9KSxcclxuICAgICAgICAgICAgICAgIGNhdGNoRXJyb3IoKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYXV0aFNlcnZpY2UuZ2V0TG9nZ2VyKCkudmVyYm9zZShcIkd1YXJkIC0gZXJyb3Igd2hpbGUgbG9nZ2luZyBpbiwgdW5hYmxlIHRvIGFjdGl2YXRlXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvZihmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICApO1xyXG4gICAgfVxyXG5cclxufVxyXG4iXX0=

@@ -8,4 +8,3 @@ /*

import { MsalService } from "./msal.service";
import { Minimatch } from "minimatch";
import { BrowserConfigurationAuthError, InteractionType } from "@azure/msal-browser";
import { BrowserConfigurationAuthError, InteractionType, StringUtils } from "@azure/msal-browser";
import { Injectable, Inject } from "@angular/core";

@@ -20,7 +19,9 @@ import { MSAL_INTERCEPTOR_CONFIG } from "./constants";

if (this.msalInterceptorConfig.interactionType !== InteractionType.Popup && this.msalInterceptorConfig.interactionType !== InteractionType.Redirect) {
throw new BrowserConfigurationAuthError("invalid_interaction_type", "Invalid interaction type provided to MSAL Interceptor. InteractionType.Popup, InteractionType.Redirect or InteractionType.Silent must be provided in the msalInterceptorConfiguration");
throw new 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");
const scopes = this.getScopesForEndpoint(req.url);
const account = this.authService.instance.getAllAccounts()[0];
if (!scopes || scopes.length === 0) {
this.authService.getLogger().verbose("Interceptor - no scopes for endpoint");
return next.handle(req);

@@ -32,4 +33,6 @@ }

if (this.msalInterceptorConfig.interactionType === InteractionType.Popup) {
this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by popup");
return this.authService.acquireTokenPopup(Object.assign(Object.assign({}, this.msalInterceptorConfig.authRequest), { scopes }));
}
this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by redirect");
const redirectStartPage = window.location.href;

@@ -39,2 +42,3 @@ this.authService.acquireTokenRedirect(Object.assign(Object.assign({}, this.msalInterceptorConfig.authRequest), { scopes, redirectStartPage }));

}), switchMap((result) => {
this.authService.getLogger().verbose("Interceptor - setting authorization headers");
const headers = req.headers

@@ -47,6 +51,6 @@ .set("Authorization", `Bearer ${result.accessToken}`);

getScopesForEndpoint(endpoint) {
this.authService.getLogger().verbose("Interceptor - getting scopes for endpoint");
const protectedResourcesArray = Array.from(this.msalInterceptorConfig.protectedResourceMap.keys());
const keyMatchesEndpointArray = protectedResourcesArray.filter(key => {
const minimatch = new Minimatch(key);
return minimatch.match(endpoint) || endpoint.indexOf(key) > -1;
return StringUtils.matchPattern(key, endpoint);
});

@@ -70,2 +74,2 @@ // process all protected resources and send the first matched resource

];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNhbC5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiJDOi9Vc2Vycy9qYW51dHRlci9Db2RlL21pY3Jvc29mdC1hdXRoZW50aWNhdGlvbi1saWJyYXJ5LWZvci1qcy9saWIvbXNhbC1hbmd1bGFyL3NyYy8iLCJzb3VyY2VzIjpbIm1zYWwuaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOlt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hdXRoU2VydmljZS5hY3F1aXJlVG9rZW5SZWRpcmVjdCh7Li4udGhpcy5tc2FsSW50ZXJjZXB0b3JDb25maWcuYXV0aFJlcXVlc3QsIHNjb3BlcywgcmVkaXJlY3RTdGFydFBhZ2V9KTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gRU1QVFk7XHJcbiAgICAgICAgICAgICAgICB9KSxcclxuICAgICAgICAgICAgICAgIHN3aXRjaE1hcCgocmVzdWx0OiBBdXRoZW50aWNhdGlvblJlc3VsdCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGhlYWRlcnMgPSByZXEuaGVhZGVyc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2V0KFwiQXV0aG9yaXphdGlvblwiLCBgQmVhcmVyICR7cmVzdWx0LmFjY2Vzc1Rva2VufWApO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICBjb25zdCByZXF1ZXN0Q2xvbmUgPSByZXEuY2xvbmUoe2hlYWRlcnN9KTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV4dC5oYW5kbGUocmVxdWVzdENsb25lKTtcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICk7XHJcblxyXG4gICAgfVxyXG5cclxuICAgIHByaXZhdGUgZ2V0U2NvcGVzRm9yRW5kcG9pbnQoZW5kcG9pbnQ6IHN0cmluZyk6IEFycmF5PHN0cmluZz58bnVsbCB7XHJcbiAgICAgICAgY29uc3QgcHJvdGVjdGVkUmVzb3VyY2VzQXJyYXkgPSBBcnJheS5mcm9tKHRoaXMubXNhbEludGVyY2VwdG9yQ29uZmlnLnByb3RlY3RlZFJlc291cmNlTWFwLmtleXMoKSk7XHJcbiAgICAgICAgY29uc3Qga2V5TWF0Y2hlc0VuZHBvaW50QXJyYXkgPSBwcm90ZWN0ZWRSZXNvdXJjZXNBcnJheS5maWx0ZXIoa2V5ID0+IHtcclxuICAgICAgICAgICAgY29uc3QgbWluaW1hdGNoID0gbmV3IE1pbmltYXRjaChrZXkpO1xyXG4gICAgICAgICAgICByZXR1cm4gbWluaW1hdGNoLm1hdGNoKGVuZHBvaW50KSB8fCBlbmRwb2ludC5pbmRleE9mKGtleSkgPiAtMTtcclxuICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgLy8gcHJvY2VzcyBhbGwgcHJvdGVjdGVkIHJlc291cmNlcyBhbmQgc2VuZCB0aGUgZmlyc3QgbWF0Y2hlZCByZXNvdXJjZVxyXG4gICAgICAgIGlmIChrZXlNYXRjaGVzRW5kcG9pbnRBcnJheS5sZW5ndGggPiAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGtleUZvckVuZHBvaW50ID0ga2V5TWF0Y2hlc0VuZHBvaW50QXJyYXlbMF07XHJcbiAgICAgICAgICAgIGlmIChrZXlGb3JFbmRwb2ludCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubXNhbEludGVyY2VwdG9yQ29uZmlnLnByb3RlY3RlZFJlc291cmNlTWFwLmdldChrZXlGb3JFbmRwb2ludCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgfVxyXG5cclxufVxyXG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNhbC5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiJDOi9Vc2Vycy9qYW51dHRlci9Db2RlL21pY3Jvc29mdC1hdXRoZW50aWNhdGlvbi1saWJyYXJ5LWZvci1qcy9saWIvbXNhbC1hbmd1bGFyL3NyYy8iLCJzb3VyY2VzIjpbIm1zYWwuaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHO0FBUUgsT0FBTyxFQUFjLEtBQUssRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUN6QyxPQUFPLEVBQUUsU0FBUyxFQUF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bnQpO1xyXG4gICAgICAgIH0pO1xyXG5cclxuICAgICAgICAvLyBwcm9jZXNzIGFsbCBwcm90ZWN0ZWQgcmVzb3VyY2VzIGFuZCBzZW5kIHRoZSBmaXJzdCBtYXRjaGVkIHJlc291cmNlXHJcbiAgICAgICAgaWYgKGtleU1hdGNoZXNFbmRwb2ludEFycmF5Lmxlbmd0aCA+IDApIHtcclxuICAgICAgICAgICAgY29uc3Qga2V5Rm9yRW5kcG9pbnQgPSBrZXlNYXRjaGVzRW5kcG9pbnRBcnJheVswXTtcclxuICAgICAgICAgICAgaWYgKGtleUZvckVuZHBvaW50KSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5tc2FsSW50ZXJjZXB0b3JDb25maWcucHJvdGVjdGVkUmVzb3VyY2VNYXAuZ2V0KGtleUZvckVuZHBvaW50KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICB9XHJcblxyXG59XHJcbiJdfQ==

@@ -7,3 +7,3 @@ /*

import { Location } from "@angular/common";
import { MSAL_INSTANCE } from "./constants";
import { MSAL_INSTANCE, name, version } from "./constants";
import { from } from "rxjs";

@@ -45,2 +45,12 @@ export class MsalService {

}
getLogger() {
if (!this.logger) {
this.logger = this.instance.getLogger().clone(name, version);
}
return this.logger;
}
setLogger(logger) {
this.logger = logger.clone(name, version);
this.instance.setLogger(logger);
}
}

@@ -54,2 +64,2 @@ MsalService.decorators = [

];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNhbC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IkM6L1VzZXJzL2phbnV0dGVyL0NvZGUvbWljcm9zb2Z0LWF1dGhlbnRpY2F0aW9uLWxpYnJhcnktZm9yLWpzL2xpYi9tc2FsLWFuZ3VsYXIvc3JjLyIsInNvdXJjZXMiOlsibXNhbC5zZXJ2aWNlLnRzIl0sIm5hbW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9pZD4ge1xyXG4gICAgICAgIHJldHVybiBmcm9tKHRoaXMuaW5zdGFuY2UubG9nb3V0KGxvZ291dFJlcXVlc3QpKTtcclxuICAgIH1cclxuICAgIHNzb1NpbGVudChyZXF1ZXN0OiBTc29TaWxlbnRSZXF1ZXN0KTogT2JzZXJ2YWJsZTxBdXRoZW50aWNhdGlvblJlc3VsdD4ge1xyXG4gICAgICAgIHJldHVybiBmcm9tKHRoaXMuaW5zdGFuY2Uuc3NvU2lsZW50KHJlcXVlc3QpKTtcclxuICAgIH1cclxuICAgIGdldExvZ2dlcigpOiBMb2dnZXIge1xyXG4gICAgICAgIGlmICghdGhpcy5sb2dnZXIpIHtcclxuICAgICAgICAgICAgdGhpcy5sb2dnZXIgPSB0aGlzLmluc3RhbmNlLmdldExvZ2dlcigpLmNsb25lKG5hbWUsIHZlcnNpb24pO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcy5sb2dnZXI7XHJcbiAgICB9XHJcbiAgICBzZXRMb2dnZXIobG9nZ2VyOiBMb2dnZXIpOiB2b2lkIHtcclxuICAgICAgICB0aGlzLmxvZ2dlciA9IGxvZ2dlci5jbG9uZShuYW1lLCB2ZXJzaW9uKTtcclxuICAgICAgICB0aGlzLmluc3RhbmNlLnNldExvZ2dlcihsb2dnZXIpO1xyXG4gICAgfVxyXG5cclxufVxyXG4iXX0=
import { InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
import { Location, CommonModule } from '@angular/common';
import { from, of, EMPTY, Subject } from 'rxjs';
import { InteractionType, BrowserConfigurationAuthError } from '@azure/msal-browser';
import { InteractionType, BrowserConfigurationAuthError, UrlString, BrowserUtils, StringUtils } from '@azure/msal-browser';
import { map, catchError, concatMap, switchMap } from 'rxjs/operators';
import { Minimatch } from 'minimatch';

@@ -15,2 +14,4 @@ /*

const MSAL_INTERCEPTOR_CONFIG = new InjectionToken("MSAL_INTERCEPTOR_CONFIG");
const name = "@azure/msal-angular";
const version = "2.0.0-alpha.0";

@@ -56,2 +57,12 @@ /*

}
getLogger() {
if (!this.logger) {
this.logger = this.instance.getLogger().clone(name, version);
}
return this.logger;
}
setLogger(logger) {
this.logger = logger.clone(name, version);
this.instance.setLogger(logger);
}
}

@@ -82,2 +93,3 @@ MsalService.decorators = [

getDestinationUrl(path) {
this.authService.getLogger().verbose("Guard - getting destination url");
// Absolute base url for the application (default to origin if base element not present)

@@ -90,2 +102,3 @@ const baseElements = document.getElementsByTagName("base");

if (pathUrl.startsWith("#")) {
this.authService.getLogger().verbose("Guard - destination by hash routing");
return `${baseUrl}/${pathUrl}`;

@@ -101,5 +114,10 @@ }

if (this.msalGuardConfig.interactionType === InteractionType.Popup) {
this.authService.getLogger().verbose("Guard - logging in by popup");
return this.authService.loginPopup(Object.assign({}, this.msalGuardConfig.authRequest))
.pipe(map(() => true), catchError(() => of(false)));
.pipe(map(() => {
this.authService.getLogger().verbose("Guard - login by popup successful, can activate");
return true;
}), catchError(() => of(false)));
}
this.authService.getLogger().verbose("Guard - logging in by redirect");
const redirectStartPage = this.getDestinationUrl(url);

@@ -113,9 +131,24 @@ this.authService.loginRedirect(Object.assign({ redirectStartPage }, this.msalGuardConfig.authRequest));

}
this.authService.getLogger().verbose("MSAL Guard activated");
/*
* If a page with MSAL Guard is set as the redirect for acquireTokenSilent,
* short-circuit to prevent redirecting or popups.
* TODO: Update to allow running in iframe once allowRedirectInIframe is implemented
*/
if (UrlString.hashContainsKnownProperties(window.location.hash) && BrowserUtils.isInIframe()) {
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.");
return of(false);
}
return this.authService.handleRedirectObservable()
.pipe(concatMap(() => {
if (!this.authService.instance.getAllAccounts().length) {
this.authService.getLogger().verbose("Guard - no accounts retrieved, log in required to activate");
return this.loginInteractively(state.url);
}
this.authService.getLogger().verbose("Guard - account retrieved, can activate");
return of(true);
}), catchError(() => of(false)));
}), catchError(() => {
this.authService.getLogger().verbose("Guard - error while logging in, unable to activate");
return of(false);
}));
}

@@ -143,7 +176,9 @@ }

if (this.msalInterceptorConfig.interactionType !== InteractionType.Popup && this.msalInterceptorConfig.interactionType !== InteractionType.Redirect) {
throw new BrowserConfigurationAuthError("invalid_interaction_type", "Invalid interaction type provided to MSAL Interceptor. InteractionType.Popup, InteractionType.Redirect or InteractionType.Silent must be provided in the msalInterceptorConfiguration");
throw new 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");
const scopes = this.getScopesForEndpoint(req.url);
const account = this.authService.instance.getAllAccounts()[0];
if (!scopes || scopes.length === 0) {
this.authService.getLogger().verbose("Interceptor - no scopes for endpoint");
return next.handle(req);

@@ -155,4 +190,6 @@ }

if (this.msalInterceptorConfig.interactionType === InteractionType.Popup) {
this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by popup");
return this.authService.acquireTokenPopup(Object.assign(Object.assign({}, this.msalInterceptorConfig.authRequest), { scopes }));
}
this.authService.getLogger().verbose("Interceptor - error acquiring token silently, acquiring by redirect");
const redirectStartPage = window.location.href;

@@ -162,2 +199,3 @@ this.authService.acquireTokenRedirect(Object.assign(Object.assign({}, this.msalInterceptorConfig.authRequest), { scopes, redirectStartPage }));

}), switchMap((result) => {
this.authService.getLogger().verbose("Interceptor - setting authorization headers");
const headers = req.headers

@@ -170,6 +208,6 @@ .set("Authorization", `Bearer ${result.accessToken}`);

getScopesForEndpoint(endpoint) {
this.authService.getLogger().verbose("Interceptor - getting scopes for endpoint");
const protectedResourcesArray = Array.from(this.msalInterceptorConfig.protectedResourceMap.keys());
const keyMatchesEndpointArray = protectedResourcesArray.filter(key => {
const minimatch = new Minimatch(key);
return minimatch.match(endpoint) || endpoint.indexOf(key) > -1;
return StringUtils.matchPattern(key, endpoint);
});

@@ -176,0 +214,0 @@ // process all protected resources and send the first matched resource

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

import { EndSessionRequest, AuthorizationUrlRequest, AuthenticationResult, PopupRequest, RedirectRequest, SilentRequest } from "@azure/msal-browser";
import { EndSessionRequest, AuthorizationUrlRequest, AuthenticationResult, PopupRequest, RedirectRequest, SilentRequest, Logger } from "@azure/msal-browser";
import { Observable } from "rxjs";

@@ -12,2 +12,4 @@ export interface IMsalService {

ssoSilent(request: AuthorizationUrlRequest): Observable<AuthenticationResult>;
getLogger(): Logger;
setLogger(logger: Logger): void;
}

@@ -18,3 +18,3 @@ import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from "@angular/router";

private loginInteractively;
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | Observable<boolean>;
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean>;
}
import { Location } from "@angular/common";
import { IPublicClientApplication, EndSessionRequest, AuthorizationUrlRequest, AuthenticationResult, RedirectRequest, SilentRequest } from "@azure/msal-browser";
import { IPublicClientApplication, EndSessionRequest, AuthenticationResult, RedirectRequest, SilentRequest, PopupRequest, SsoSilentRequest, Logger } from "@azure/msal-browser";
import { Observable } from "rxjs";

@@ -9,11 +9,14 @@ import { IMsalService } from "./IMsalService";

private redirectHash;
private logger;
constructor(instance: IPublicClientApplication, location: Location);
acquireTokenPopup(request: AuthorizationUrlRequest): Observable<AuthenticationResult>;
acquireTokenPopup(request: PopupRequest): Observable<AuthenticationResult>;
acquireTokenRedirect(request: RedirectRequest): Observable<void>;
acquireTokenSilent(silentRequest: SilentRequest): Observable<AuthenticationResult>;
handleRedirectObservable(): Observable<AuthenticationResult>;
loginPopup(request?: AuthorizationUrlRequest): Observable<AuthenticationResult>;
loginPopup(request?: PopupRequest): Observable<AuthenticationResult>;
loginRedirect(request?: RedirectRequest): Observable<void>;
logout(logoutRequest?: EndSessionRequest): Observable<void>;
ssoSilent(request: AuthorizationUrlRequest): Observable<AuthenticationResult>;
ssoSilent(request: SsoSilentRequest): Observable<AuthenticationResult>;
getLogger(): Logger;
setLogger(logger: Logger): void;
}
{
"name": "@azure/msal-angular",
"version": "2.0.0-alpha.0",
"version": "2.0.0-alpha.1",
"main": "bundles/azure-msal-angular.umd.js",
"typings": "azure-msal-angular.d.ts",
"dependencies": {
"minimatch": "^3.0.4",
"path": "^0.12.7",
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "9 - 10",
"@angular/core": "9 - 10",
"@azure/msal-browser": "^2.4.0",
"@angular/common": "9 - 11",
"@angular/core": "9 - 11",
"@azure/msal-browser": "^2.8.0",
"rxjs": "^6.0.0"

@@ -22,3 +17,6 @@ },

"metadata": "azure-msal-angular.metadata.json",
"sideEffects": false
"sideEffects": false,
"dependencies": {
"tslib": "^2.0.0"
}
}

@@ -46,3 +46,3 @@ # Microsoft Authentication Library for Angular

|----------------------|-------------------------|----------------------------|
| 2.x.x | Active development | 9, 10 |
| 2.x.x | Active development | 9, 10, 11 |
| 1.x.x | Active development | 6, 7, 8, 9 |

@@ -59,3 +59,3 @@ | 0.x.x | In maintenance | 4, 5 |

```
npm install msal @azure/msal-angular --save
npm install @azure/msal-browser @azure/msal-angular@alpha
```

@@ -76,2 +76,3 @@

5. [Internet Explorer Support](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/msal-angular-v2/lib/msal-angular/docs/v2-docs/ie-support.md)
6. [Events](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/msal-angular-v2/lib/msal-angular/docs/v2-docs/events.md)

@@ -91,4 +92,8 @@ All documentation for MSAL Angular v1 can be found [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/msal-angular-v2/lib/msal-angular/docs/v1-docs/).

### MSAL Angular 2.x Samples
* [Angular v9](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v2/samples/msal-angular-v2-samples/angular9-v2-sample-app)
* [Angular v10](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v2/samples/msal-angular-v2-samples/angular10-sample-app)
* [Angular v11](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v2/samples/msal-angular-v2-samples/angular11-sample-app)
* [Angular v11 B2C Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v2/samples/msal-angular-v2-samples/angular11-b2c-sample)
## Build and running tests

@@ -95,0 +100,0 @@

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