angular-simple-oidc
Advanced tools
Comparing version 8.1.2 to 8.1.3
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("angular-simple-oidc/config"),require("rxjs/operators"),require("angular-simple-oidc/events"),require("angular-simple-oidc/core"),require("@angular/common/http"),require("angular-simple-oidc/operators")):"function"==typeof define&&define.amd?define("angular-simple-oidc",["exports","@angular/core","rxjs","angular-simple-oidc/config","rxjs/operators","angular-simple-oidc/events","angular-simple-oidc/core","@angular/common/http","angular-simple-oidc/operators"],t):t((e=e||self)["angular-simple-oidc"]={},e.ng.core,e.rxjs,e["angular-simple-oidc"].config,e.rxjs.operators,e["angular-simple-oidc"].events,e["angular-simple-oidc"].core,e.ng.common.http,e["angular-simple-oidc"].operators)}(this,function(e,t,n,r,o,i,a,s,c){"use strict";var u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function p(e,t){function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var d=function(){return(d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var f=["clientId","openIDProviderUrl"];var v=function(e){function t(t){return e.call(this,"Token endpoint returned unexpected error","token-endpoint-unexpected-error",t)||this}return p(t,e),t}(a.SimpleOidcError),g=function(e){function t(t,n){return e.call(this,"Token endpoint returned error: "+t,"token-endpoint-"+t,n)||this}return p(t,e),t}(a.SimpleOidcError),k=function(e){function t(){return e.call(this,"Expected AUTH_CONFIG to be in Injector.\nYou need to provide a configuration either with AngularSimpleOidc.forRoot() or by adding your own (Observable<AuthConfig> | AuthConfig) into the injector with the AUTH_CONFIG injection token.","auth-config-missing",null)||this}return p(t,e),t}(a.SimpleOidcError),y=function(e){function t(t){return e.call(this,"User Info is not supported, or it's URL was not in discovery document","user-info-not-suppo",t)||this}return p(t,e),t}(a.SimpleOidcError),S=new t.InjectionToken("Angular Simple OIDC Window Reference"),m=new t.InjectionToken("Angular Simple OIDC LocalStorage Reference");function I(){return localStorage}var w={provide:m,useFactory:I};function T(){return window}var E={provide:S,useFactory:T},C=new t.InjectionToken("AUTH_CONFIG"),b=new t.InjectionToken("AUTH_CONFIG"),O={discoveryDocumentUrl:"/.well-known/openid-configuration",tokenCallbackRoute:"oidc-token-callback",tokenValidation:{disableIdTokenIATValidation:!1,idTokenIATOffsetAllowed:10},enableAuthorizationCallbackAppInitializer:!0};function A(e,t,r,i){if(!e)throw new k;var a=n.isObservable(e)?e:n.of(e);return function(){return a.pipe(o.map(function(e){return e&&e.openIDProviderUrl?d({},e,{openIDProviderUrl:e.openIDProviderUrl.toLowerCase()}):e}),o.tap(function(e){return t.configure(e,{defaultConfig:d({},O,{baseUrl:(n=document.querySelector("base"),n&&n.href||"")}),requiredFields:f});var n}),o.catchError(function(e){return console.error("Callback failed in AUTH_CONFIG_INITIALIZER"),console.error(e),i.dispatchError(e),n.of(null)})).toPromise()}}var j={multi:!0,provide:t.APP_INITIALIZER,deps:[[new t.Optional,b],C,S,i.EventsService],useFactory:A},U={provide:C,useClass:r.ConfigService},P=function(){function e(e){this.localStorage=e,this.localStateSubject=new n.BehaviorSubject(this.getCurrentLocalState())}return Object.defineProperty(e.prototype,"currentState$",{get:function(){return this.localStateSubject.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storage",{get:function(){return this.localStorage},enumerable:!0,configurable:!0}),e.prototype.storePreAuthorizationState=function(e){this.storage.setItem(a.TokenStorageKeys.Nonce,e.nonce),this.storage.setItem(a.TokenStorageKeys.State,e.state),this.storage.setItem(a.TokenStorageKeys.CodeVerifier,e.codeVerifier),this.storage.setItem(a.TokenStorageKeys.PreRedirectUrl,e.preRedirectUrl);var t=this.getCurrentLocalState();return this.localStateSubject.next(t),n.of(t)},e.prototype.clearPreAuthorizationState=function(){this.storage.removeItem(a.TokenStorageKeys.Nonce),this.storage.removeItem(a.TokenStorageKeys.State),this.storage.removeItem(a.TokenStorageKeys.CodeVerifier),this.storage.removeItem(a.TokenStorageKeys.PreRedirectUrl);var e=this.getCurrentLocalState();return this.localStateSubject.next(e),n.of(e)},e.prototype.storeAuthorizationCode=function(e,t){this.storage.setItem(a.TokenStorageKeys.AuthorizationCode,e),t&&this.storage.setItem(a.TokenStorageKeys.SessionState,t);var r=this.getCurrentLocalState();return this.localStateSubject.next(r),n.of(r)},e.prototype.storeOriginalIdToken=function(e){this.storage.setItem(a.TokenStorageKeys.OriginalIdentityToken,e);var t=this.getCurrentLocalState();return this.localStateSubject.next(t),n.of(t)},e.prototype.storeTokens=function(e){this.storage.setItem(a.TokenStorageKeys.IdentityToken,e.idToken),this.storeJSON(a.TokenStorageKeys.IdentityTokenDecoded,e.decodedIdToken),this.storage.setItem(a.TokenStorageKeys.AccessToken,e.accessToken),e.accessTokenExpiresAt&&this.storage.setItem(a.TokenStorageKeys.AccessTokenExpiration,e.accessTokenExpiresAt.toString()),e.refreshToken&&this.storage.setItem(a.TokenStorageKeys.RefreshToken,e.refreshToken);var t=this.getCurrentLocalState();return this.localStateSubject.next(t),n.of(t)},e.prototype.removeAll=function(){var e,t;try{for(var r=l(Object.keys(a.TokenStorageKeys)),o=r.next();!o.done;o=r.next()){var i=o.value;this.storage.removeItem(a.TokenStorageKeys[i])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n.of(this.getCurrentLocalState())},e.prototype.getCurrentLocalState=function(){return{nonce:this.storage.getItem(a.TokenStorageKeys.Nonce),state:this.storage.getItem(a.TokenStorageKeys.State),codeVerifier:this.storage.getItem(a.TokenStorageKeys.CodeVerifier),authorizationCode:this.storage.getItem(a.TokenStorageKeys.AuthorizationCode),sessionState:this.storage.getItem(a.TokenStorageKeys.SessionState),identityToken:this.storage.getItem(a.TokenStorageKeys.IdentityToken),originalIdentityToken:this.storage.getItem(a.TokenStorageKeys.OriginalIdentityToken),accessToken:this.storage.getItem(a.TokenStorageKeys.AccessToken),accessTokenExpiration:parseInt(this.storage.getItem(a.TokenStorageKeys.AccessTokenExpiration),10),refreshToken:this.storage.getItem(a.TokenStorageKeys.RefreshToken),preRedirectUrl:this.storage.getItem(a.TokenStorageKeys.PreRedirectUrl),decodedIdentityToken:this.readJSON(a.TokenStorageKeys.IdentityTokenDecoded)}},e.prototype.storeJSON=function(e,t){this.storage.setItem(e,JSON.stringify(t))},e.prototype.readJSON=function(e){var t=this.storage.getItem(e);return t?JSON.parse(t):null},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Storage,decorators:[{type:t.Inject,args:[m]}]}]},e}();var _=/^(\w+:\/\/[^\/?]+)?(.*?)(\?.+)?$/,F=/^(\/\/[^\/?]+)(.*?)(\?.+)?$/;function N(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r=e[e.length-1];r&&"object"==typeof r&&(n=r,e=e.slice(0,-1)),n=d({leadingSlash:!0,trailingSlash:!1,protocolRelative:!1},n);var o=function(e,t){var n=t.protocolRelative&&e.match(F)||e.match(_)||[];return{beforePathname:n[1]||"",pathname:(n[2]||"").replace(/^\/+/,"").replace(/\/+$/,"").replace(/\/+/g,"/"),afterPathname:n[3]||""}}(e.filter(function(e){return"string"==typeof e||"number"==typeof e}).join("/"),n),i=o.beforePathname,a=o.pathname,s=(o.afterPathname,"");return i?s+=i+(a?"/":""):n.leadingSlash&&(s+="/"),s+=a,n.trailingSlash&&!s.endsWith("/")&&(s+="/"),s}var M=function(e){function t(t){return e.call(this,"Failed to obtain discovery document","discovery-doc-fetch-failed",t)||this}return p(t,e),t}(a.SimpleOidcError),R=function(e){function t(t){return e.call(this,"Failed to obtain JWT Keys","jwt-keys-fetch-failed",t)||this}return p(t,e),t}(a.SimpleOidcError),x=function(e){function t(t){return e.call(this,"Discovery Document Obtained",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),$=function(){function e(e,t,r){var a=this;this.config=e,this.http=t,this.events=r,this.current$=this.config.current$.pipe(o.map(function(e){return N(e.openIDProviderUrl,e.discoveryDocumentUrl)}),o.tap(function(e){return a.events.dispatch(new i.SimpleOidcInfoEvent("Obtaining discovery document",e))}),o.switchMap(function(e){return a.http.get(e)}),o.tap(function(e){return a.events.dispatch(new x(e))}),o.catchError(function(e){return n.throwError(new M(e))}),o.take(1),o.shareReplay()),this.jwtKeys$=this.current$.pipe(o.tap(function(e){return a.events.dispatch(new i.SimpleOidcInfoEvent("Obtaining JWT Keys",e.jwks_uri))}),o.switchMap(function(e){return a.http.get(e.jwks_uri)}),o.tap(function(e){return a.events.dispatch(new i.SimpleOidcInfoEvent("JWT Keys obtained",e))}),o.catchError(function(e){return n.throwError(new R(e))}),o.take(1),o.shareReplay())}return e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:s.HttpClient},{type:i.EventsService}]},e}();var D=function(e){function t(t){return e.call(this,"Tokens obtained",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),L=function(e){function t(t){return e.call(this,"Tokens validated",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),V=function(e){function t(t){return e.call(this,"Tokens are ready to be used (validated and stored)",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),H=function(e){function t(t){return e.call(this,"Access token has expired",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),z=function(e){function t(t){return e.call(this,"Access token is almost expired",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),K=function(e){function t(t){return e.call(this,"Obtained User Profile",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent);var G=function(){function e(e,t,n,r,o){this.http=e,this.discoveryDocumentClient=t,this.tokenValidation=n,this.tokenHelper=r,this.events=o}return e.prototype.call=function(e){var t=this,n=(new s.HttpHeaders).set("Content-Type","application/x-www-form-urlencoded");return this.discoveryDocumentClient.current$.pipe(o.take(1),o.switchMap(function(r){var o=r.token_endpoint;return t.events.dispatch(new i.SimpleOidcInfoEvent("Executing Token Endpoint",{url:o,payload:e})),t.http.post(o,e,{headers:n})}),o.tap({error:function(e){if(!(e instanceof a.SimpleOidcError))throw 400===e.status?new g(e.error.error,e):new v(e)}}),o.map(function(e){var n,r;e.expires_in?n=t.tokenHelper.getExpirationFromExpiresIn(e.expires_in):t.events.dispatch(new i.SimpleOidcInfoEvent("Token Response did not contain expires_in",e)),e.id_token?(t.events.dispatch(new i.SimpleOidcInfoEvent("Validating Identity Token format",e.id_token)),t.tokenValidation.validateIdTokenFormat(e.id_token),r=t.tokenHelper.getPayloadFromToken(e.id_token),t.events.dispatch(new i.SimpleOidcInfoEvent("Identity Token Payload decoded",r))):t.events.dispatch(new i.SimpleOidcInfoEvent("Token Response did not contain id_token",e));var o={accessToken:e.access_token,accessTokenExpiresIn:e.expires_in,accessTokenExpiresAt:n?n.getTime():null,error:e.error,idToken:e.id_token,refreshToken:e.refresh_token,decodedIdToken:r};return t.events.dispatch(new D(o)),o}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:s.HttpClient},{type:$},{type:a.TokenValidationService},{type:a.TokenHelperService},{type:i.EventsService}]},e}();var W=function(){function e(e){this.document=e,this.handle=this.document.createElement("iframe")}return e.prototype.appendTo=function(e){return e.appendChild(this.handle),this},e.prototype.appendToBody=function(){return this.appendTo(this.document.body),this},e.prototype.setSource=function(e){return this.handle.src=e,this},e.prototype.hide=function(){return this.handle.style.display="none",this},e.prototype.postMessage=function(e,t){return this.handle.contentWindow.postMessage(e,t),this},e.prototype.remove=function(){return this.handle.parentElement.removeChild(this.handle),this},e}();var q=function(){function e(e){this.window=e,this.pending=[]}return e.prototype.create=function(){var e=new W(this.window.document);return this.pending.push(e),e},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(S))},token:e,providedIn:"root"}),e}();var Z=function(){function e(e,t,n,r,o,i,a,s,c){this.window=e,this.config=t,this.discoveryDocumentClient=n,this.tokenStorage=r,this.tokenValidation=o,this.tokenUrl=i,this.tokenEndpointClient=a,this.events=s,this.dynamicIframe=c}return e.prototype.startCodeFlow=function(e){var t=this;void 0===e&&(e={});var n=d({},e);return n.returnUrlAfterCallback||(n.returnUrlAfterCallback=this.window.location.href),this.config.current$.pipe(o.map(function(e){return N(e.baseUrl,e.tokenCallbackRoute)}),o.switchMap(function(e){return t.generateCodeFlowMetadata({redirectUri:e})}),o.tap(function(){return t.events.dispatch(new i.SimpleOidcInfoEvent("Starting Code Flow"))}),o.switchMap(function(e){return t.events.dispatch(new i.SimpleOidcInfoEvent("Authorize URL generated",e)),t.tokenStorage.storePreAuthorizationState({nonce:e.nonce,state:e.state,codeVerifier:e.codeVerifier,preRedirectUrl:n.returnUrlAfterCallback}).pipe(o.tap(function(n){t.events.dispatch(new i.SimpleOidcInfoEvent("Pre-authorize state stored",n)),t.redirectToUrl(e.url)}))}),o.take(1))},e.prototype.generateCodeFlowMetadata=function(e){var t=this;return this.discoveryDocumentClient.current$.pipe(o.withLatestFrom(this.config.current$),o.map(function(n){var r=h(n,2),o=r[0],i=r[1];return t.tokenUrl.createAuthorizeUrl(o.authorization_endpoint,d({clientId:i.clientId,scope:i.scope,responseType:"code"},e))}),o.take(1))},e.prototype.parseCodeFlowCallbackParams=function(e){try{var t=this.tokenUrl.parseAuthorizeCallbackParamsFromUrl(e);return d({},t,{href:e})}catch(e){throw new a.AuthorizationCallbackFormatError(e)}},e.prototype.validateCodeFlowCallback=function(e,t){var n=e.href,r=e.code,o=e.state,a=e.error;this.events.dispatch(new i.SimpleOidcInfoEvent("Validating URL params",{code:r,state:o,error:a,href:n})),this.tokenValidation.validateAuthorizeCallbackFormat(r,o,a,n),this.events.dispatch(new i.SimpleOidcInfoEvent("Validating state vs local state",{localState:t,state:o})),this.tokenValidation.validateAuthorizeCallbackState(t,o),this.events.dispatch(new i.SimpleOidcInfoEvent("Obtained authorization code.",{code:r,state:o}))},e.prototype.codeFlowCallback=function(e,t,n){var r=this,i=this.parseCodeFlowCallbackParams(e);return this.validateCodeFlowCallback(i,n.state),this.tokenStorage.storeAuthorizationCode(i.code,i.sessionState).pipe(o.switchMap(function(){return r.config.current$}),o.switchMap(function(e){var o=r.tokenUrl.createAuthorizationCodeRequestPayload({clientId:e.clientId,clientSecret:e.clientSecret,scope:e.scope,redirectUri:t,code:i.code,codeVerifier:n.codeVerifier});return r.requestTokenWithAuthCode(o,n.nonce)}))},e.prototype.currentWindowCodeFlowCallback=function(){var e=this;return this.tokenStorage.currentState$.pipe(o.take(1),o.tap(function(){return e.events.dispatch(new i.SimpleOidcInfoEvent("Starting Code Flow callback"))}),o.withLatestFrom(this.config.current$),o.map(function(e){var t=h(e,2),n=t[0],r=t[1];return{localState:n,redirectUri:N(r.baseUrl,r.tokenCallbackRoute)}}),o.switchMap(function(t){var n=t.localState,r=t.redirectUri;return e.codeFlowCallback(e.window.location.href,r,n).pipe(o.tap(function(){return e.historyChangeUrl(n.preRedirectUrl)}))}),o.take(1))},e.prototype.requestTokenWithAuthCode=function(e,t){var n=this,r=this.discoveryDocumentClient.current$.pipe(o.take(1)),a=this.discoveryDocumentClient.jwtKeys$.pipe(o.take(1));return this.tokenEndpointClient.call(e).pipe(o.tap(function(){return n.events.dispatch(new i.SimpleOidcInfoEvent("Requesting token using authorization code",e))}),o.withLatestFrom(r,a,this.config.current$),o.take(1),o.tap(function(e){var r=h(e,4),o=r[0],a=r[1],s=r[2],c=r[3];n.events.dispatch(new i.SimpleOidcInfoEvent("Validating identity token..",{result:o,nonce:t,discoveryDocument:a,jwtKeys:s})),n.tokenValidation.validateIdToken(c.clientId,o.idToken,o.decodedIdToken,t,a,s,c.tokenValidation)}),o.tap(function(e){var t=h(e,1)[0];n.events.dispatch(new i.SimpleOidcInfoEvent("Validating access token..",t)),n.tokenValidation.validateAccessToken(t.accessToken,t.decodedIdToken.at_hash)}),c.switchTap(function(){return n.events.dispatch(new i.SimpleOidcInfoEvent("Clearing pre-authorize state..")),n.tokenStorage.clearPreAuthorizationState()}),c.switchTap(function(e){var t=h(e,1)[0];return n.events.dispatch(new L(t)),n.events.dispatch(new i.SimpleOidcInfoEvent("Storing tokens..",t)),n.tokenStorage.storeTokens(t)}),c.switchTap(function(e){var t=h(e,1)[0];return n.events.dispatch(new i.SimpleOidcInfoEvent("Storing original Identity Token..",t.idToken)),n.tokenStorage.storeOriginalIdToken(t.idToken)}),o.map(function(e){return h(e,1)[0]}),o.tap(function(e){return n.events.dispatch(new V(e))}))},e.prototype.redirectToUrl=function(e){this.events.dispatch(new i.SimpleOidcInfoEvent("Redirecting",e)),this.window.location.href=e},e.prototype.historyChangeUrl=function(e){this.window.history?(this.events.dispatch(new i.SimpleOidcInfoEvent("Changing URL with history API",e)),this.window.history.pushState({},null,e)):this.redirectToUrl(e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:$},{type:P},{type:a.TokenValidationService},{type:a.TokenUrlService},{type:G},{type:i.EventsService},{type:q}]},e}();function J(e,t,r,i){return function(){return e.current$.pipe(o.take(1),o.switchMap(function(e){return e.enableAuthorizationCallbackAppInitializer&&i.location.pathname.includes(e.tokenCallbackRoute)?t.currentWindowCodeFlowCallback():n.of(null)}),o.catchError(function(e){return console.error("Callback failed in APP_INITIALIZER"),console.error(e),r.dispatchError(e),n.of(null)})).toPromise()}}var B={provide:t.APP_INITIALIZER,useFactory:J,deps:[C,Z,i.EventsService,S],multi:!0},Y=function(){function e(e,t,n,r,o,i,a,s){this.config=e,this.tokenStorage=t,this.tokenUrl=n,this.tokenHelper=r,this.tokenEndpointClient=o,this.refreshTokenValidation=i,this.tokenValidation=a,this.events=s}return e.prototype.requestTokenWithRefreshCode=function(){var e=this;return this.tokenStorage.currentState$.pipe(o.withLatestFrom(this.config.current$),o.take(1),o.switchMap(function(t){var n=h(t,2),r=n[0],o=n[1],a=e.tokenUrl.createRefreshTokenRequestPayload({clientId:o.clientId,clientSecret:o.clientSecret,refreshToken:r.refreshToken});return e.events.dispatch(new i.SimpleOidcInfoEvent("Refreshing token using refresh code",{payload:a,refreshToken:r.refreshToken})),e.tokenEndpointClient.call(a)}),o.withLatestFrom(this.tokenStorage.currentState$),o.tap(function(t){var n=h(t,2),r=n[0],o=n[1],a=e.tokenHelper.getPayloadFromToken(o.originalIdentityToken);e.events.dispatch(new i.SimpleOidcInfoEvent("Validating new Identity Token against original",{result:r,originalToken:a})),e.refreshTokenValidation.validateIdToken(a,r.decodedIdToken)}),o.tap(function(t){var n=h(t,1)[0];e.events.dispatch(new i.SimpleOidcInfoEvent("Validating access token against at_hash",{accessToken:n.accessToken,hash:n.decodedIdToken.at_hash})),e.tokenValidation.validateAccessToken(n.accessToken,n.decodedIdToken.at_hash)}),o.tap(function(t){var n=h(t,1)[0];return e.events.dispatch(new L(n))}),o.switchMap(function(t){var n=h(t,1)[0];return e.events.dispatch(new i.SimpleOidcInfoEvent("Storing new tokens..",n)),e.tokenStorage.storeTokens(n).pipe(o.map(function(){return n}))}),o.tap(function(t){return e.events.dispatch(new V(t))}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:P},{type:a.TokenUrlService},{type:a.TokenHelperService},{type:G},{type:a.RefreshTokenValidationService},{type:a.TokenValidationService},{type:i.EventsService}]},e}();var Q=function(){function e(e,t,n,r,o){this.window=e,this.discoveryDocumentClient=t,this.tokenUrl=n,this.tokenStorage=r,this.events=o}return e.prototype.logoutWithRedirect=function(e){var t=this,r=this.discoveryDocumentClient.current$,a=this.tokenStorage.currentState$;return n.combineLatest(r,a).pipe(o.take(1),o.map(function(n){var r=h(n,2),o=r[0],i=r[1];return t.tokenUrl.createEndSessionUrl(o.end_session_endpoint,{idTokenHint:i.identityToken,postLogoutRedirectUri:e})}),c.switchTap(function(){return t.events.dispatch(new i.SimpleOidcInfoEvent("Deleting Local Session")),t.tokenStorage.removeAll()}),o.tap(function(e){var n=e.url;t.events.dispatch(new i.SimpleOidcInfoEvent("Redirecting to End Session Endpoint",n)),t.window.location.href=n}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:$},{type:a.TokenUrlService},{type:P},{type:i.EventsService}]},e}();var X=function(){function e(e,t,n,r){this.discoveryDocumentClient=e,this.tokenStorage=t,this.events=n,this.http=r}return e.prototype.getUserInfo=function(){var e=this,t=this.discoveryDocumentClient.current$,r=this.tokenStorage.currentState$;return n.combineLatest(t,r).pipe(o.take(1),o.tap(function(){return e.events.dispatch(new i.SimpleOidcInfoEvent("Requesting User Info"))}),o.tap(function(e){var t=h(e,1)[0];if(!t.userinfo_endpoint)throw new y(t)}),o.switchMap(function(t){var n=h(t,2),r=n[0],o=n[1];return e.http.get(r.userinfo_endpoint,{headers:new s.HttpHeaders({authorization:"Bearer "+o.accessToken})})}),o.tap(function(t){return e.events.dispatch(new K(t))}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:$},{type:P},{type:i.EventsService},{type:s.HttpClient}]},e}();var ee=function(){function e(e,t,n,r,i,a,s,u){var p=this;this.oidcClient=e,this.tokenHelper=t,this.tokenStorage=n,this.refreshTokenClient=r,this.endSessionClient=i,this.config=a,this.events=s,this.userInfoClient=u,this.userInfo$=this.events$.pipe(c.filterInstanceOf(V),o.switchMap(function(){return p.userInfoClient.getUserInfo()}),o.shareReplay())}return Object.defineProperty(e.prototype,"isLoggedIn$",{get:function(){var e=this;return this.tokenStorage.currentState$.pipe(o.map(function(t){var n=t.accessToken,r=t.accessTokenExpiration;return!(!n||e.tokenHelper.isTokenExpired(r))}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accessToken$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return e.accessToken}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tokenExpiration$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return new Date(e.accessTokenExpiration)}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"refreshToken$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return e.refreshToken}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identityToken$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return e.identityToken}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identityTokenDecoded$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return e.decodedIdentityToken}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"events$",{get:function(){return this.events.events$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errors$",{get:function(){return this.events.errors$},enumerable:!0,configurable:!0}),e.prototype.startCodeFlow=function(e){var t=this;return this.oidcClient.startCodeFlow(e).pipe(o.tap({error:function(e){return t.events.dispatchError(e)}}))},e.prototype.refreshAccessToken=function(){var e=this;return this.refreshTokenClient.requestTokenWithRefreshCode().pipe(o.tap({error:function(t){return e.events.dispatchError(t)}}))},e.prototype.endSession=function(e){var t=this;return this.config.current$.pipe(o.take(1),o.switchMap(function(n){return t.endSessionClient.logoutWithRedirect(e||n.baseUrl)}),o.tap({error:function(e){return t.events.dispatchError(e)}}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Z},{type:a.TokenHelperService},{type:P},{type:Y},{type:Q},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:i.EventsService},{type:X}]},e}();var te=function(){function e(e,t){this.auth=e,this.events=t}return e.prototype.canActivate=function(e,t){var r=this;return this.auth.isLoggedIn$.pipe(o.take(1),o.switchMap(function(e){return e?n.of(!0):(r.events.dispatch(new i.SimpleOidcInfoEvent("Route requires auth. No token or it's expired.",{route:t.url})),r.auth.startCodeFlow({returnUrlAfterCallback:t.url}).pipe(o.map(function(){return!1})))}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:ee},{type:i.EventsService}]},e}();var ne=function(){function e(e,t,r,a){var s=this;this.auth=e,this.events=t,this.storage=r,this.tokenHelper=a,this.destroyedSubject=new n.Subject,r.currentState$.pipe(o.take(1)).subscribe(function(e){(e.accessToken||e.identityToken||e.refreshToken)&&(a.isTokenExpired(e.accessTokenExpiration)?s.events.dispatch(new i.SimpleOidcInfoEvent("Have token in storage but is expired")):s.events.dispatch(new V({accessToken:e.accessToken,accessTokenExpiresAt:e.accessTokenExpiration,decodedIdToken:e.decodedIdentityToken,idToken:e.identityToken,refreshToken:e.refreshToken})))}),this.watchTokenExpiration()}return e.prototype.watchTokenExpiration=function(){var e=this;this.auth.events$.pipe(c.filterInstanceOf(V),o.switchMap(function(e){var t=e.payload;if(t.accessToken&&t.accessTokenExpiresAt){var r=new Date(t.accessTokenExpiresAt),a=new Date(t.accessTokenExpiresAt);a.setSeconds(a.getSeconds()-60);var s=n.of(new z({token:t.accessToken,expiresAt:r})).pipe(o.delay(a)),c=n.of(new H({token:t.accessToken,expiredAt:r})).pipe(o.delay(r));return n.merge(s,c)}return n.of(new i.SimpleOidcInfoEvent("TokenExpired event not configured due to access token or expiration empty."))}),o.takeUntil(this.destroyedSubject)).subscribe(function(t){t.payload&&(t.payload.now=new Date),e.events.dispatch(t)})},e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.decorators=[{type:t.NgModule,args:[{imports:[],providers:[],declarations:[]}]}],e.ctorParameters=function(){return[{type:ee},{type:i.EventsService},{type:P},{type:a.TokenHelperService}]},e}();var re=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[null!=t?{provide:b,useValue:t}:[],U,j,B]}},e.decorators=[{type:t.NgModule,args:[{imports:[s.HttpClientModule,a.AngularSimpleOidcCoreModule,ne],providers:[E,w,P,G,$,Z,Y,Q,X,ee,te],declarations:[],exports:[a.AngularSimpleOidcCoreModule]}]}],e}();var oe=function(){function e(e,t){var r=this;this.auth=e,this.events=t,this.destroyedSubject=new n.Subject,this.auth.events$.pipe(c.filterInstanceOf(z),o.switchMap(function(){return r.auth.refreshAccessToken()}),o.takeUntil(this.destroyedSubject)).subscribe()}return e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.decorators=[{type:t.NgModule,args:[{imports:[],providers:[],declarations:[]}]}],e.ctorParameters=function(){return[{type:ee},{type:i.EventsService}]},e}();var ie=function(e){function t(t){return e.call(this,"Session check not supported by OP: check_session_iframe on discovery document and session_state are required","session-check-not-supported",t)||this}return p(t,e),t}(a.SimpleOidcError),ae=function(e){function t(t){return e.call(this,"OP iframe returned error. According to spec, message malformed?","session-check-error",t)||this}return p(t,e),t}(a.SimpleOidcError),se=function(e){function t(t){return e.call(this,"Iframe failed to postMessage back in given time.","iframe-post-message-timeout",t)||this}return p(t,e),t}(a.SimpleOidcError),ce=function(e){function t(){return e.call(this,"Expected SESSION_MANAGEMENT_CONFIG to be in Injector.\nYou need to provide a configuration either with SessionManagementModule.forRoot() or by adding your own (Observable<SessionManagementConfig> | SessionManagementConfig) into the injector with the SESSION_MANAGEMENT_CONFIG injection token.","session-management-config-missing",null)||this}return p(t,e),t}(a.SimpleOidcError),ue=function(e){function t(){return e.call(this,"Session has changed.")||this}return p(t,e),t}(i.SimpleOidcInfoEvent),pe=function(e){function t(t){return e.call(this,"Session has been terminated.",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),de=["iframePath"];var le=new t.InjectionToken("SESSION_MANAGEMENT_CONFIG_SERVICE"),he=new t.InjectionToken("SESSION_MANAGEMENT_CONFIG"),fe={opIframePollInterval:1e3,iframeTimeout:1e4};function ve(e,t,r){if(!e)throw new ce;var i=n.isObservable(e)?e:n.of(e);return function(){return i.pipe(o.tap(function(e){return t.configure(e,{defaultConfig:fe,requiredFields:de})}),o.catchError(function(e){return console.error("Callback failed in SESSION_MANAGEMENT_CONFIG_INITIALIZER"),console.error(e),r.dispatchError(e),n.of(null)})).toPromise()}}var ge={multi:!0,provide:t.APP_INITIALIZER,deps:[[new t.Optional,he],le,i.EventsService],useFactory:ve},ke={provide:le,useClass:r.ConfigService},ye=function(){function e(e,t,r,o,i,a,s){this.window=e,this.discoveryClient=t,this.dynamicIframe=r,this.tokenStorage=o,this.config=i,this.sessionConfig=a,this.events=s,this.destroyedSubject=new n.Subject}return e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.prototype.startSessionCheck=function(){var e=this,t=this.tokenStorage.currentState$.pipe(o.take(1)),r=this.discoveryClient.current$.pipe(o.take(1)),a=this.dynamicIframe.create().hide();return n.combineLatest(r,t).pipe(o.tap(function(){return e.events.dispatch(new i.SimpleOidcInfoEvent("Starting Session Check"))}),o.map(function(e){var t=h(e,2),n=t[0],r=t[1];if(n.check_session_iframe&&r.sessionState)return a.setSource(n.check_session_iframe).appendToBody(),r;throw new ie({doc:n,localState:r})}),o.withLatestFrom(this.config.current$,this.sessionConfig.current$),o.take(1),o.switchMap(function(t){var r=h(t,3),i=r[0],s=r[1],c=r[2],u=new URL(s.openIDProviderUrl).origin,p=n.interval(c.opIframePollInterval).pipe(o.map(function(){return s.clientId.toLowerCase()+" "+i.sessionState}),o.tap(function(e){return a.postMessage(e,u)})),d=n.fromEvent(e.window,"message").pipe(o.filter(function(e){return e.origin===u}),o.map(function(t){return e.fireEventsFromMessage(t)}),o.filter(function(e){return!!e}));return n.combineLatest(p,d).pipe(o.map(function(e){return e[1]}))}),o.finalize(function(){return a.remove()}),o.takeUntil(this.destroyedSubject.asObservable()))},e.prototype.fireEventsFromMessage=function(e){var t=e.data;switch(t){case"changed":return this.events.dispatch(new ue),t;case"unchanged":return t;case"error":throw new ae(e);default:return null}},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:$},{type:q},{type:P},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:r.ConfigService,decorators:[{type:t.Inject,args:[le]}]},{type:i.EventsService}]},e}();var Se=function(){function e(e,t,n,r,o,i,a,s,c){this.window=e,this.discoveryClient=t,this.dynamicIframe=n,this.tokenStorage=r,this.authConfig=o,this.sessionConfig=i,this.events=a,this.oidcClient=s,this.tokenUrl=c}return e.prototype.startCodeFlowInIframe=function(){var e=this,t=this.authConfig.current$.pipe(o.withLatestFrom(this.sessionConfig.current$),o.map(function(e){var t=h(e,2),n=t[0],r=t[1];return N(n.baseUrl,r.iframePath)}));return this.tokenStorage.currentState$.pipe(o.take(1),o.tap(function(){return e.events.dispatch(new i.SimpleOidcInfoEvent("Starting Code Flow in iframe"))}),o.withLatestFrom(t),o.switchMap(function(t){var n=h(t,2),r=n[0].identityToken,i=n[1];return e.oidcClient.generateCodeFlowMetadata({redirectUri:i,prompt:"none",idTokenHint:r}).pipe(o.map(function(e){return{metadata:e,iframeUrl:i}}))}),o.withLatestFrom(this.sessionConfig.current$),o.take(1),o.switchMap(function(t){var r=h(t,2),a=r[0],s=a.metadata,c=a.iframeUrl,u=r[1];e.events.dispatch(new i.SimpleOidcInfoEvent("Creating iframe",s));var p=e.dynamicIframe.create().hide().setSource(s.url).appendToBody();return n.fromEvent(e.window,"message").pipe(o.map(function(e){return{event:e,iframe:p,metadata:s,iframeUrl:c}}),o.filter(function(e){return e.event.data.startsWith(c)}),o.take(1),o.timeout(u.iframeTimeout),o.catchError(function(e){if(e.name&&"TimeoutError"===e.name)throw new se({iframe:p,e:e});return n.throwError(e)}))}),o.map(function(t){var n=t.event,r=t.iframe,o=t.metadata,a=t.iframeUrl,s=n.data;return e.events.dispatch(new i.SimpleOidcInfoEvent("Obtained data from iframe",{event:n,href:s})),r.remove(),{href:s,iframeUrl:a,metadata:o}}),o.switchMap(function(t){var n=t.href,r=t.iframeUrl,o=t.metadata;return e.oidcClient.codeFlowCallback(n,r,o)}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:$},{type:q},{type:P},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:r.ConfigService,decorators:[{type:t.Inject,args:[le]}]},{type:i.EventsService},{type:Z},{type:a.TokenUrlService}]},e}();var me=function(){function e(e,t,r,a){var s=this;this.sessionCheck=e,this.events=t,this.authorizeSilentClient=r,this.tokenStorage=a,this.destroyedSubject=new n.Subject;var u=this.events.events$.pipe(c.filterInstanceOf(ue));this.events.events$.pipe(c.filterInstanceOf(V),o.switchMap(function(){return s.sessionCheck.startSessionCheck().pipe(o.takeUntil(u))}),o.takeUntil(this.destroyedSubject)).subscribe();var p=this.tokenStorage.currentState$.pipe(o.take(1),o.switchMap(function(e){return s.authorizeSilentClient.startCodeFlowInIframe().pipe(o.map(function(t){return{result:t,previousState:e}}))}),o.tap(function(e){var t=e.result,n=e.previousState,r=t.decodedIdToken,o=n.decodedIdentityToken;o&&r.sub!==o.sub&&s.events.dispatch(new pe({previousToken:o,newToken:r}))}),o.catchError(function(e){return s.events.dispatch(new pe({error:e.context})),n.of(null)}));this.events.events$.pipe(c.filterInstanceOf(ue),o.tap(function(){return s.events.dispatch(new i.SimpleOidcInfoEvent("Session has changed. Starting silent code flow."))}),o.switchMap(function(){return p}),o.takeUntil(this.destroyedSubject)).subscribe()}return e.forRoot=function(t){return{ngModule:e,providers:[null!=t?{provide:he,useValue:t}:[],ke,ge]}},e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.decorators=[{type:t.NgModule,args:[{imports:[],providers:[ye,Se],declarations:[]}]}],e.ctorParameters=function(){return[{type:ye},{type:i.EventsService},{type:Se},{type:P}]},e}();var Ie=function(e){function t(t){return e.call(this,"Child window has been closed, no response was received","child-window-closed",t)||this}return p(t,e),t}(a.SimpleOidcError),we=function(e){function t(){return e.call(this,"Expected POPUP_AUTHORIZATION_CONFIG to be in Injector.\nYou need to provide a configuration either with PopupAuthorizationModule.forRoot() or by adding your own (Observable<PopupAuthorizationConfig> | PopupAuthorizationConfig) into the injector with the POPUP_AUTHORIZATION_CONFIG injection token.","popup-authorization-config-missing",null)||this}return p(t,e),t}(a.SimpleOidcError),Te=["childWindowPath"];var Ee=new t.InjectionToken("POPUP_AUTHORIZATION_CONFIG_SERVICE"),Ce=new t.InjectionToken("POPUP_AUTHORIZATION_CONFIG"),be={};function Oe(e,t,r){if(!e)throw new we;var i=n.isObservable(e)?e:n.of(e);return function(){return i.pipe(o.tap(function(e){return t.configure(e,{defaultConfig:be,requiredFields:Te})}),o.catchError(function(e){return console.error("Callback failed in POPUP_AUTHORIZATION_CONFIG_INITIALIZER"),console.error(e),r.dispatchError(e),n.of(null)})).toPromise()}}var Ae={multi:!0,provide:t.APP_INITIALIZER,deps:[[new t.Optional,Ce],Ee,i.EventsService],useFactory:Oe},je={provide:Ee,useClass:r.ConfigService},Ue=function(){function e(e,t,r,o,i,a,s){this.window=e,this.tokenStorage=t,this.authConfig=r,this.popupConfig=o,this.events=i,this.oidcClient=a,this.tokenUrl=s,this.destroyedSubject=new n.Subject}return e.prototype.startCodeFlowInPopup=function(e){var t=this;return void 0===e&&(e={}),this.authConfig.current$.pipe(o.withLatestFrom(this.popupConfig.current$),o.map(function(e){var t=h(e,2),n=t[0],r=t[1];return N(n.baseUrl,r.childWindowPath)}),o.take(1)).pipe(o.tap(function(){return t.events.dispatch(new i.SimpleOidcInfoEvent("Starting Code Flow in child window"))}),o.switchMap(function(e){return t.oidcClient.generateCodeFlowMetadata({redirectUri:e,display:"popup"}).pipe(o.map(function(t){return{metadata:t,redirectUri:e}}))}),o.take(1),o.switchMap(function(r){var a=r.metadata,s=r.redirectUri;t.events.dispatch(new i.SimpleOidcInfoEvent("Creating window",a));var c=t.window.open(a.url,"_blank",t.calculatePopupFeatures(e)),u=n.interval(500).pipe(o.tap(function(){return console.info("polling")}),o.filter(function(){return c.closed}),o.tap(function(){return t.events.dispatch(new i.SimpleOidcInfoEvent("Child Window has been closed"))}),o.tap(function(){throw new Ie({metadata:a,redirectUri:s})}),o.take(1));return n.fromEvent(t.window,"message").pipe(o.map(function(e){return{event:e,handle:c,metadata:a,redirectUri:s}}),o.filter(function(e){var t=e.event;return t.data&&"string"==typeof t.data}),o.filter(function(e){return e.event.data.startsWith(s)}),o.take(1),o.takeUntil(u))}),o.map(function(e){var n=e.event,r=e.handle,o=e.metadata,a=e.redirectUri,s=n.data;return t.events.dispatch(new i.SimpleOidcInfoEvent("Obtained data from window",{event:n,href:s})),r.close(),{href:s,metadata:o,redirectUri:a}}),o.switchMap(function(e){var n=e.href,r=e.redirectUri,o=e.metadata;return t.oidcClient.codeFlowCallback(n,r,o)}),o.takeUntil(this.destroyedSubject))},e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.prototype.calculatePopupFeatures=function(e){var t=e.height||660,n=e.width||500,r=this.window.screen,o=r.width/2-n/2;return"location=no,toolbar=no,width="+n+",height="+t+",top="+(r.height/2-t/2)+",left="+o},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:P},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:r.ConfigService,decorators:[{type:t.Inject,args:[Ee]}]},{type:i.EventsService},{type:Z},{type:a.TokenUrlService}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(S),t.ɵɵinject(P),t.ɵɵinject(C),t.ɵɵinject(Ee),t.ɵɵinject(i.EventsService),t.ɵɵinject(Z),t.ɵɵinject(a.TokenUrlService))},token:e,providedIn:"root"}),e}();var Pe=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[null!=t?{provide:Ce,useValue:t}:[],je,Ae]}},e.decorators=[{type:t.NgModule,args:[{imports:[],providers:[Ue],declarations:[]}]}],e}();e.AUTH_CONFIG=b,e.AUTH_CONFIG_SERVICE=C,e.AccessTokenExpiredEvent=H,e.AccessTokenExpiringEvent=z,e.AngularSimpleOidcModule=re,e.AuthGuard=te,e.AuthService=ee,e.AuthenticationConfigurationMissingError=k,e.AuthorizeEndpointPopupClientService=Ue,e.AuthorizeEndpointSilentClientService=Se,e.AutomaticRefreshModule=oe,e.ChildWindowClosedError=Ie,e.DiscoveryDocumentObtainedEvent=x,e.EndSessionClientService=Q,e.IframePostMessageTimeoutError=se,e.LOCAL_STORAGE_REF=m,e.OidcCodeFlowClient=Z,e.OidcDiscoveryDocClient=$,e.POPUP_AUTHORIZATION_CONFIG=Ce,e.POPUP_AUTHORIZATION_CONFIG_REQUIRED_FIELDS=Te,e.POPUP_AUTHORIZATION_CONFIG_SERVICE=Ee,e.PopupAuthorizationConfigurationMissingError=we,e.PopupAuthorizationModule=Pe,e.RefreshTokenClient=Y,e.SESSION_MANAGEMENT_CONFIG=he,e.SESSION_MANAGEMENT_CONFIG_REQUIRED_FIELDS=de,e.SESSION_MANAGEMENT_CONFIG_SERVICE=le,e.SessionChangedEvent=ue,e.SessionCheckFailedError=ae,e.SessionCheckNotSupportedError=ie,e.SessionCheckService=ye,e.SessionManagementConfigurationMissingError=ce,e.SessionManagementModule=me,e.SessionTerminatedEvent=pe,e.TokenEndpointError=g,e.TokenEndpointUnexpectedError=v,e.TokenStorageService=P,e.TokensObtainedEvent=D,e.TokensReadyEvent=V,e.TokensValidatedEvent=L,e.UserInfoNotSupportedError=y,e.UserInfoObtainedEvent=K,e.WINDOW_REF=S,e.ɵa=I,e.ɵb=w,e.ɵc=T,e.ɵd=E,e.ɵe=A,e.ɵf=j,e.ɵg=U,e.ɵh=ve,e.ɵi=ge,e.ɵj=ke,e.ɵk=Oe,e.ɵl=Ae,e.ɵm=je,e.ɵn=ne,e.ɵo=G,e.ɵp=q,e.ɵq=X,e.ɵr=J,e.ɵs=B,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("angular-simple-oidc/config"),require("rxjs/operators"),require("angular-simple-oidc/events"),require("angular-simple-oidc/core"),require("@angular/common/http"),require("angular-simple-oidc/operators")):"function"==typeof define&&define.amd?define("angular-simple-oidc",["exports","@angular/core","rxjs","angular-simple-oidc/config","rxjs/operators","angular-simple-oidc/events","angular-simple-oidc/core","@angular/common/http","angular-simple-oidc/operators"],t):t((e=e||self)["angular-simple-oidc"]={},e.ng.core,e.rxjs,e["angular-simple-oidc"].config,e.rxjs.operators,e["angular-simple-oidc"].events,e["angular-simple-oidc"].core,e.ng.common.http,e["angular-simple-oidc"].operators)}(this,function(e,t,n,r,o,i,a,s,c){"use strict";var u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function p(e,t){function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var d=function(){return(d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var f=["clientId","openIDProviderUrl"];var v=function(e){function t(t){return e.call(this,"Token endpoint returned unexpected error","token-endpoint-unexpected-error",t)||this}return p(t,e),t}(a.SimpleOidcError),g=function(e){function t(t,n){return e.call(this,"Token endpoint returned error: "+t,"token-endpoint-"+t,n)||this}return p(t,e),t}(a.SimpleOidcError),k=function(e){function t(){return e.call(this,"Expected AUTH_CONFIG to be in Injector.\nYou need to provide a configuration either with AngularSimpleOidc.forRoot() or by adding your own (Observable<AuthConfig> | AuthConfig) into the injector with the AUTH_CONFIG injection token.","auth-config-missing",null)||this}return p(t,e),t}(a.SimpleOidcError),y=function(e){function t(t){return e.call(this,"User Info is not supported, or it's URL was not in discovery document","user-info-not-suppo",t)||this}return p(t,e),t}(a.SimpleOidcError),S=new t.InjectionToken("Angular Simple OIDC Window Reference"),m=new t.InjectionToken("Angular Simple OIDC LocalStorage Reference");function I(){return localStorage}var w={provide:m,useFactory:I};function T(){return window}var E={provide:S,useFactory:T},C=new t.InjectionToken("AUTH_CONFIG"),b=new t.InjectionToken("AUTH_CONFIG"),O={discoveryDocumentUrl:"/.well-known/openid-configuration",tokenCallbackRoute:"oidc-token-callback",tokenValidation:{disableIdTokenIATValidation:!1,idTokenIATOffsetAllowed:10},enableAuthorizationCallbackAppInitializer:!0};function A(e,t,r,i){if(!e)throw new k;var a=n.isObservable(e)?e:n.of(e);return function(){return a.pipe(o.map(function(e){return e&&e.openIDProviderUrl?d({},e,{openIDProviderUrl:e.openIDProviderUrl.toLowerCase()}):e}),o.tap(function(e){return t.configure(e,{defaultConfig:d({},O,{baseUrl:(n=document.querySelector("base"),n&&n.href||"")}),requiredFields:f});var n}),o.catchError(function(e){return console.error("Callback failed in AUTH_CONFIG_INITIALIZER"),console.error(e),i.dispatchError(e),n.of(null)})).toPromise()}}var j={multi:!0,provide:t.APP_INITIALIZER,deps:[[new t.Optional,b],C,S,i.EventsService],useFactory:A},U={provide:C,useClass:r.ConfigService},P=function(){function e(e){this.localStorage=e,this.localStateSubject=new n.BehaviorSubject(this.getCurrentLocalState())}return Object.defineProperty(e.prototype,"currentState$",{get:function(){return this.localStateSubject.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storage",{get:function(){return this.localStorage},enumerable:!0,configurable:!0}),e.prototype.storePreAuthorizationState=function(e){this.storage.setItem(a.TokenStorageKeys.Nonce,e.nonce),this.storage.setItem(a.TokenStorageKeys.State,e.state),this.storage.setItem(a.TokenStorageKeys.CodeVerifier,e.codeVerifier),this.storage.setItem(a.TokenStorageKeys.PreRedirectUrl,e.preRedirectUrl);var t=this.getCurrentLocalState();return this.localStateSubject.next(t),n.of(t)},e.prototype.clearPreAuthorizationState=function(){this.storage.removeItem(a.TokenStorageKeys.Nonce),this.storage.removeItem(a.TokenStorageKeys.State),this.storage.removeItem(a.TokenStorageKeys.CodeVerifier),this.storage.removeItem(a.TokenStorageKeys.PreRedirectUrl);var e=this.getCurrentLocalState();return this.localStateSubject.next(e),n.of(e)},e.prototype.storeAuthorizationCode=function(e,t){this.storage.setItem(a.TokenStorageKeys.AuthorizationCode,e),t&&this.storage.setItem(a.TokenStorageKeys.SessionState,t);var r=this.getCurrentLocalState();return this.localStateSubject.next(r),n.of(r)},e.prototype.storeOriginalIdToken=function(e){this.storage.setItem(a.TokenStorageKeys.OriginalIdentityToken,e);var t=this.getCurrentLocalState();return this.localStateSubject.next(t),n.of(t)},e.prototype.storeTokens=function(e){this.storage.setItem(a.TokenStorageKeys.IdentityToken,e.idToken),this.storeJSON(a.TokenStorageKeys.IdentityTokenDecoded,e.decodedIdToken),this.storage.setItem(a.TokenStorageKeys.AccessToken,e.accessToken),e.accessTokenExpiresAt&&this.storage.setItem(a.TokenStorageKeys.AccessTokenExpiration,e.accessTokenExpiresAt.toString()),e.refreshToken&&this.storage.setItem(a.TokenStorageKeys.RefreshToken,e.refreshToken);var t=this.getCurrentLocalState();return this.localStateSubject.next(t),n.of(t)},e.prototype.removeAll=function(){var e,t;try{for(var r=l(Object.keys(a.TokenStorageKeys)),o=r.next();!o.done;o=r.next()){var i=o.value;this.storage.removeItem(a.TokenStorageKeys[i])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n.of(this.getCurrentLocalState())},e.prototype.getCurrentLocalState=function(){return{nonce:this.storage.getItem(a.TokenStorageKeys.Nonce),state:this.storage.getItem(a.TokenStorageKeys.State),codeVerifier:this.storage.getItem(a.TokenStorageKeys.CodeVerifier),authorizationCode:this.storage.getItem(a.TokenStorageKeys.AuthorizationCode),sessionState:this.storage.getItem(a.TokenStorageKeys.SessionState),identityToken:this.storage.getItem(a.TokenStorageKeys.IdentityToken),originalIdentityToken:this.storage.getItem(a.TokenStorageKeys.OriginalIdentityToken),accessToken:this.storage.getItem(a.TokenStorageKeys.AccessToken),accessTokenExpiration:parseInt(this.storage.getItem(a.TokenStorageKeys.AccessTokenExpiration),10),refreshToken:this.storage.getItem(a.TokenStorageKeys.RefreshToken),preRedirectUrl:this.storage.getItem(a.TokenStorageKeys.PreRedirectUrl),decodedIdentityToken:this.readJSON(a.TokenStorageKeys.IdentityTokenDecoded)}},e.prototype.storeJSON=function(e,t){this.storage.setItem(e,JSON.stringify(t))},e.prototype.readJSON=function(e){var t=this.storage.getItem(e);return t?JSON.parse(t):null},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Storage,decorators:[{type:t.Inject,args:[m]}]}]},e}();var _=/^(\w+:\/\/[^\/?]+)?(.*?)(\?.+)?$/,F=/^(\/\/[^\/?]+)(.*?)(\?.+)?$/;function N(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r=e[e.length-1];r&&"object"==typeof r&&(n=r,e=e.slice(0,-1)),n=d({leadingSlash:!0,trailingSlash:!1,protocolRelative:!1},n);var o=function(e,t){var n=t.protocolRelative&&e.match(F)||e.match(_)||[];return{beforePathname:n[1]||"",pathname:(n[2]||"").replace(/^\/+/,"").replace(/\/+$/,"").replace(/\/+/g,"/"),afterPathname:n[3]||""}}(e.filter(function(e){return"string"==typeof e||"number"==typeof e}).join("/"),n),i=o.beforePathname,a=o.pathname,s=(o.afterPathname,"");return i?s+=i+(a?"/":""):n.leadingSlash&&(s+="/"),s+=a,n.trailingSlash&&!s.endsWith("/")&&(s+="/"),s}var M=function(e){function t(t){return e.call(this,"Failed to obtain discovery document","discovery-doc-fetch-failed",t)||this}return p(t,e),t}(a.SimpleOidcError),R=function(e){function t(t){return e.call(this,"Failed to obtain JWT Keys","jwt-keys-fetch-failed",t)||this}return p(t,e),t}(a.SimpleOidcError),x=function(e){function t(t){return e.call(this,"Discovery Document Obtained",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),$=function(){function e(e,t,r){var a=this;this.config=e,this.http=t,this.events=r,this.current$=this.config.current$.pipe(o.map(function(e){return N(e.openIDProviderUrl,e.discoveryDocumentUrl)}),o.tap(function(e){return a.events.dispatch(new i.SimpleOidcInfoEvent("Obtaining discovery document",e))}),o.switchMap(function(e){return a.http.get(e)}),o.tap(function(e){return a.events.dispatch(new x(e))}),o.catchError(function(e){return n.throwError(new M(e))}),o.take(1),o.shareReplay()),this.jwtKeys$=this.current$.pipe(o.tap(function(e){return a.events.dispatch(new i.SimpleOidcInfoEvent("Obtaining JWT Keys",e.jwks_uri))}),o.switchMap(function(e){return a.http.get(e.jwks_uri)}),o.tap(function(e){return a.events.dispatch(new i.SimpleOidcInfoEvent("JWT Keys obtained",e))}),o.catchError(function(e){return n.throwError(new R(e))}),o.take(1),o.shareReplay())}return e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:s.HttpClient},{type:i.EventsService}]},e}();var D=function(e){function t(t){return e.call(this,"Tokens obtained",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),L=function(e){function t(t){return e.call(this,"Tokens validated",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),V=function(e){function t(t){return e.call(this,"Tokens are ready to be used (validated and stored)",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),H=function(e){function t(t){return e.call(this,"Access token has expired",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),z=function(e){function t(t){return e.call(this,"Access token is almost expired",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),K=function(e){function t(t){return e.call(this,"Obtained User Profile",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent);var G=function(){function e(e,t,n,r,o){this.http=e,this.discoveryDocumentClient=t,this.tokenValidation=n,this.tokenHelper=r,this.events=o}return e.prototype.call=function(e){var t=this,n=(new s.HttpHeaders).set("Content-Type","application/x-www-form-urlencoded");return this.discoveryDocumentClient.current$.pipe(o.take(1),o.switchMap(function(r){var o=r.token_endpoint;return t.events.dispatch(new i.SimpleOidcInfoEvent("Executing Token Endpoint",{url:o,payload:e})),t.http.post(o,e,{headers:n})}),o.tap({error:function(e){if(!(e instanceof a.SimpleOidcError))throw 400===e.status?new g(e.error.error,e):new v(e)}}),o.map(function(e){var n,r;e.expires_in?n=t.tokenHelper.getExpirationFromExpiresIn(e.expires_in):t.events.dispatch(new i.SimpleOidcInfoEvent("Token Response did not contain expires_in",e)),e.id_token?(t.events.dispatch(new i.SimpleOidcInfoEvent("Validating Identity Token format",e.id_token)),t.tokenValidation.validateIdTokenFormat(e.id_token),r=t.tokenHelper.getPayloadFromToken(e.id_token),t.events.dispatch(new i.SimpleOidcInfoEvent("Identity Token Payload decoded",r))):t.events.dispatch(new i.SimpleOidcInfoEvent("Token Response did not contain id_token",e));var o={accessToken:e.access_token,accessTokenExpiresIn:e.expires_in,accessTokenExpiresAt:n?n.getTime():null,error:e.error,idToken:e.id_token,refreshToken:e.refresh_token,decodedIdToken:r};return t.events.dispatch(new D(o)),o}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:s.HttpClient},{type:$},{type:a.TokenValidationService},{type:a.TokenHelperService},{type:i.EventsService}]},e}();var W=function(){function e(e){this.document=e,this.handle=this.document.createElement("iframe")}return e.prototype.appendTo=function(e){return e.appendChild(this.handle),this},e.prototype.appendToBody=function(){return this.appendTo(this.document.body),this},e.prototype.setSource=function(e){return this.handle.src=e,this},e.prototype.hide=function(){return this.handle.style.display="none",this},e.prototype.postMessage=function(e,t){return this.handle.contentWindow.postMessage(e,t),this},e.prototype.remove=function(){return this.handle.parentElement&&this.handle.parentElement.removeChild(this.handle),this},e}();var q=function(){function e(e){this.window=e,this.pending=[]}return e.prototype.create=function(){var e=new W(this.window.document);return this.pending.push(e),e},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(S))},token:e,providedIn:"root"}),e}();var Z=function(){function e(e,t,n,r,o,i,a,s,c){this.window=e,this.config=t,this.discoveryDocumentClient=n,this.tokenStorage=r,this.tokenValidation=o,this.tokenUrl=i,this.tokenEndpointClient=a,this.events=s,this.dynamicIframe=c}return e.prototype.startCodeFlow=function(e){var t=this;void 0===e&&(e={});var n=d({},e);return n.returnUrlAfterCallback||(n.returnUrlAfterCallback=this.window.location.href),this.config.current$.pipe(o.map(function(e){return N(e.baseUrl,e.tokenCallbackRoute)}),o.switchMap(function(e){return t.generateCodeFlowMetadata({redirectUri:e})}),o.tap(function(){return t.events.dispatch(new i.SimpleOidcInfoEvent("Starting Code Flow"))}),o.switchMap(function(e){return t.events.dispatch(new i.SimpleOidcInfoEvent("Authorize URL generated",e)),t.tokenStorage.storePreAuthorizationState({nonce:e.nonce,state:e.state,codeVerifier:e.codeVerifier,preRedirectUrl:n.returnUrlAfterCallback}).pipe(o.tap(function(n){t.events.dispatch(new i.SimpleOidcInfoEvent("Pre-authorize state stored",n)),t.redirectToUrl(e.url)}))}),o.take(1))},e.prototype.generateCodeFlowMetadata=function(e){var t=this;return this.discoveryDocumentClient.current$.pipe(o.withLatestFrom(this.config.current$),o.map(function(n){var r=h(n,2),o=r[0],i=r[1];return t.tokenUrl.createAuthorizeUrl(o.authorization_endpoint,d({clientId:i.clientId,scope:i.scope,responseType:"code"},e))}),o.take(1))},e.prototype.parseCodeFlowCallbackParams=function(e){try{var t=this.tokenUrl.parseAuthorizeCallbackParamsFromUrl(e);return d({},t,{href:e})}catch(e){throw new a.AuthorizationCallbackFormatError(e)}},e.prototype.validateCodeFlowCallback=function(e,t){var n=e.href,r=e.code,o=e.state,a=e.error;this.events.dispatch(new i.SimpleOidcInfoEvent("Validating URL params",{code:r,state:o,error:a,href:n})),this.tokenValidation.validateAuthorizeCallbackFormat(r,o,a,n),this.events.dispatch(new i.SimpleOidcInfoEvent("Validating state vs local state",{localState:t,state:o})),this.tokenValidation.validateAuthorizeCallbackState(t,o),this.events.dispatch(new i.SimpleOidcInfoEvent("Obtained authorization code.",{code:r,state:o}))},e.prototype.codeFlowCallback=function(e,t,n){var r=this,i=this.parseCodeFlowCallbackParams(e);return this.validateCodeFlowCallback(i,n.state),this.tokenStorage.storeAuthorizationCode(i.code,i.sessionState).pipe(o.switchMap(function(){return r.config.current$}),o.switchMap(function(e){var o=r.tokenUrl.createAuthorizationCodeRequestPayload({clientId:e.clientId,clientSecret:e.clientSecret,scope:e.scope,redirectUri:t,code:i.code,codeVerifier:n.codeVerifier});return r.requestTokenWithAuthCode(o,n.nonce)}))},e.prototype.currentWindowCodeFlowCallback=function(){var e=this;return this.tokenStorage.currentState$.pipe(o.take(1),o.tap(function(){return e.events.dispatch(new i.SimpleOidcInfoEvent("Starting Code Flow callback"))}),o.withLatestFrom(this.config.current$),o.map(function(e){var t=h(e,2),n=t[0],r=t[1];return{localState:n,redirectUri:N(r.baseUrl,r.tokenCallbackRoute)}}),o.switchMap(function(t){var n=t.localState,r=t.redirectUri;return e.codeFlowCallback(e.window.location.href,r,n).pipe(o.tap(function(){return e.historyChangeUrl(n.preRedirectUrl)}))}),o.take(1))},e.prototype.requestTokenWithAuthCode=function(e,t){var n=this,r=this.discoveryDocumentClient.current$.pipe(o.take(1)),a=this.discoveryDocumentClient.jwtKeys$.pipe(o.take(1));return this.tokenEndpointClient.call(e).pipe(o.tap(function(){return n.events.dispatch(new i.SimpleOidcInfoEvent("Requesting token using authorization code",e))}),o.withLatestFrom(r,a,this.config.current$),o.take(1),o.tap(function(e){var r=h(e,4),o=r[0],a=r[1],s=r[2],c=r[3];n.events.dispatch(new i.SimpleOidcInfoEvent("Validating identity token..",{result:o,nonce:t,discoveryDocument:a,jwtKeys:s})),n.tokenValidation.validateIdToken(c.clientId,o.idToken,o.decodedIdToken,t,a,s,c.tokenValidation)}),o.tap(function(e){var t=h(e,1)[0];n.events.dispatch(new i.SimpleOidcInfoEvent("Validating access token..",t)),n.tokenValidation.validateAccessToken(t.accessToken,t.decodedIdToken.at_hash)}),c.switchTap(function(){return n.events.dispatch(new i.SimpleOidcInfoEvent("Clearing pre-authorize state..")),n.tokenStorage.clearPreAuthorizationState()}),c.switchTap(function(e){var t=h(e,1)[0];return n.events.dispatch(new L(t)),n.events.dispatch(new i.SimpleOidcInfoEvent("Storing tokens..",t)),n.tokenStorage.storeTokens(t)}),c.switchTap(function(e){var t=h(e,1)[0];return n.events.dispatch(new i.SimpleOidcInfoEvent("Storing original Identity Token..",t.idToken)),n.tokenStorage.storeOriginalIdToken(t.idToken)}),o.map(function(e){return h(e,1)[0]}),o.tap(function(e){return n.events.dispatch(new V(e))}))},e.prototype.redirectToUrl=function(e){this.events.dispatch(new i.SimpleOidcInfoEvent("Redirecting",e)),this.window.location.href=e},e.prototype.historyChangeUrl=function(e){this.window.history?(this.events.dispatch(new i.SimpleOidcInfoEvent("Changing URL with history API",e)),this.window.history.pushState({},null,e)):this.redirectToUrl(e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:$},{type:P},{type:a.TokenValidationService},{type:a.TokenUrlService},{type:G},{type:i.EventsService},{type:q}]},e}();function J(e,t,r,i){return function(){return e.current$.pipe(o.take(1),o.switchMap(function(e){return e.enableAuthorizationCallbackAppInitializer&&i.location.pathname.includes(e.tokenCallbackRoute)?t.currentWindowCodeFlowCallback():n.of(null)}),o.catchError(function(e){return console.error("Callback failed in APP_INITIALIZER"),console.error(e),r.dispatchError(e),n.of(null)})).toPromise()}}var B={provide:t.APP_INITIALIZER,useFactory:J,deps:[C,Z,i.EventsService,S],multi:!0},Y=function(){function e(e,t,n,r,o,i,a,s){this.config=e,this.tokenStorage=t,this.tokenUrl=n,this.tokenHelper=r,this.tokenEndpointClient=o,this.refreshTokenValidation=i,this.tokenValidation=a,this.events=s}return e.prototype.requestTokenWithRefreshCode=function(){var e=this;return this.tokenStorage.currentState$.pipe(o.withLatestFrom(this.config.current$),o.take(1),o.switchMap(function(t){var n=h(t,2),r=n[0],o=n[1],a=e.tokenUrl.createRefreshTokenRequestPayload({clientId:o.clientId,clientSecret:o.clientSecret,refreshToken:r.refreshToken});return e.events.dispatch(new i.SimpleOidcInfoEvent("Refreshing token using refresh code",{payload:a,refreshToken:r.refreshToken})),e.tokenEndpointClient.call(a)}),o.withLatestFrom(this.tokenStorage.currentState$),o.tap(function(t){var n=h(t,2),r=n[0],o=n[1],a=e.tokenHelper.getPayloadFromToken(o.originalIdentityToken);e.events.dispatch(new i.SimpleOidcInfoEvent("Validating new Identity Token against original",{result:r,originalToken:a})),e.refreshTokenValidation.validateIdToken(a,r.decodedIdToken)}),o.tap(function(t){var n=h(t,1)[0];e.events.dispatch(new i.SimpleOidcInfoEvent("Validating access token against at_hash",{accessToken:n.accessToken,hash:n.decodedIdToken.at_hash})),e.tokenValidation.validateAccessToken(n.accessToken,n.decodedIdToken.at_hash)}),o.tap(function(t){var n=h(t,1)[0];return e.events.dispatch(new L(n))}),o.switchMap(function(t){var n=h(t,1)[0];return e.events.dispatch(new i.SimpleOidcInfoEvent("Storing new tokens..",n)),e.tokenStorage.storeTokens(n).pipe(o.map(function(){return n}))}),o.tap(function(t){return e.events.dispatch(new V(t))}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:P},{type:a.TokenUrlService},{type:a.TokenHelperService},{type:G},{type:a.RefreshTokenValidationService},{type:a.TokenValidationService},{type:i.EventsService}]},e}();var Q=function(){function e(e,t,n,r,o){this.window=e,this.discoveryDocumentClient=t,this.tokenUrl=n,this.tokenStorage=r,this.events=o}return e.prototype.logoutWithRedirect=function(e){var t=this,r=this.discoveryDocumentClient.current$,a=this.tokenStorage.currentState$;return n.combineLatest(r,a).pipe(o.take(1),o.map(function(n){var r=h(n,2),o=r[0],i=r[1];return t.tokenUrl.createEndSessionUrl(o.end_session_endpoint,{idTokenHint:i.identityToken,postLogoutRedirectUri:e})}),c.switchTap(function(){return t.events.dispatch(new i.SimpleOidcInfoEvent("Deleting Local Session")),t.tokenStorage.removeAll()}),o.tap(function(e){var n=e.url;t.events.dispatch(new i.SimpleOidcInfoEvent("Redirecting to End Session Endpoint",n)),t.window.location.href=n}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:$},{type:a.TokenUrlService},{type:P},{type:i.EventsService}]},e}();var X=function(){function e(e,t,n,r){this.discoveryDocumentClient=e,this.tokenStorage=t,this.events=n,this.http=r}return e.prototype.getUserInfo=function(){var e=this,t=this.discoveryDocumentClient.current$,r=this.tokenStorage.currentState$;return n.combineLatest(t,r).pipe(o.take(1),o.tap(function(){return e.events.dispatch(new i.SimpleOidcInfoEvent("Requesting User Info"))}),o.tap(function(e){var t=h(e,1)[0];if(!t.userinfo_endpoint)throw new y(t)}),o.switchMap(function(t){var n=h(t,2),r=n[0],o=n[1];return e.http.get(r.userinfo_endpoint,{headers:new s.HttpHeaders({authorization:"Bearer "+o.accessToken})})}),o.tap(function(t){return e.events.dispatch(new K(t))}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:$},{type:P},{type:i.EventsService},{type:s.HttpClient}]},e}();var ee=function(){function e(e,t,n,r,i,a,s,u){var p=this;this.oidcClient=e,this.tokenHelper=t,this.tokenStorage=n,this.refreshTokenClient=r,this.endSessionClient=i,this.config=a,this.events=s,this.userInfoClient=u,this.userInfo$=this.events$.pipe(c.filterInstanceOf(V),o.switchMap(function(){return p.userInfoClient.getUserInfo()}),o.shareReplay())}return Object.defineProperty(e.prototype,"isLoggedIn$",{get:function(){var e=this;return this.tokenStorage.currentState$.pipe(o.map(function(t){var n=t.accessToken,r=t.accessTokenExpiration;return!(!n||e.tokenHelper.isTokenExpired(r))}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accessToken$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return e.accessToken}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tokenExpiration$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return new Date(e.accessTokenExpiration)}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"refreshToken$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return e.refreshToken}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identityToken$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return e.identityToken}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identityTokenDecoded$",{get:function(){return this.tokenStorage.currentState$.pipe(o.map(function(e){return e.decodedIdentityToken}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"events$",{get:function(){return this.events.events$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errors$",{get:function(){return this.events.errors$},enumerable:!0,configurable:!0}),e.prototype.startCodeFlow=function(e){var t=this;return this.oidcClient.startCodeFlow(e).pipe(o.tap({error:function(e){return t.events.dispatchError(e)}}))},e.prototype.refreshAccessToken=function(){var e=this;return this.refreshTokenClient.requestTokenWithRefreshCode().pipe(o.tap({error:function(t){return e.events.dispatchError(t)}}))},e.prototype.endSession=function(e){var t=this;return this.config.current$.pipe(o.take(1),o.switchMap(function(n){return t.endSessionClient.logoutWithRedirect(e||n.baseUrl)}),o.tap({error:function(e){return t.events.dispatchError(e)}}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Z},{type:a.TokenHelperService},{type:P},{type:Y},{type:Q},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:i.EventsService},{type:X}]},e}();var te=function(){function e(e,t){this.auth=e,this.events=t}return e.prototype.canActivate=function(e,t){var r=this;return this.auth.isLoggedIn$.pipe(o.take(1),o.switchMap(function(e){return e?n.of(!0):(r.events.dispatch(new i.SimpleOidcInfoEvent("Route requires auth. No token or it's expired.",{route:t.url})),r.auth.startCodeFlow({returnUrlAfterCallback:t.url}).pipe(o.map(function(){return!1})))}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:ee},{type:i.EventsService}]},e}();var ne=function(){function e(e,t,r,a){var s=this;this.auth=e,this.events=t,this.storage=r,this.tokenHelper=a,this.destroyedSubject=new n.Subject,r.currentState$.pipe(o.take(1)).subscribe(function(e){(e.accessToken||e.identityToken||e.refreshToken)&&(a.isTokenExpired(e.accessTokenExpiration)?s.events.dispatch(new i.SimpleOidcInfoEvent("Have token in storage but is expired")):s.events.dispatch(new V({accessToken:e.accessToken,accessTokenExpiresAt:e.accessTokenExpiration,decodedIdToken:e.decodedIdentityToken,idToken:e.identityToken,refreshToken:e.refreshToken})))}),this.watchTokenExpiration()}return e.prototype.watchTokenExpiration=function(){var e=this;this.auth.events$.pipe(c.filterInstanceOf(V),o.switchMap(function(e){var t=e.payload;if(t.accessToken&&t.accessTokenExpiresAt){var r=new Date(t.accessTokenExpiresAt),a=new Date(t.accessTokenExpiresAt);a.setSeconds(a.getSeconds()-60);var s=n.of(new z({token:t.accessToken,expiresAt:r})).pipe(o.delay(a)),c=n.of(new H({token:t.accessToken,expiredAt:r})).pipe(o.delay(r));return n.merge(s,c)}return n.of(new i.SimpleOidcInfoEvent("TokenExpired event not configured due to access token or expiration empty."))}),o.takeUntil(this.destroyedSubject)).subscribe(function(t){t.payload&&(t.payload.now=new Date),e.events.dispatch(t)})},e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.decorators=[{type:t.NgModule,args:[{imports:[],providers:[],declarations:[]}]}],e.ctorParameters=function(){return[{type:ee},{type:i.EventsService},{type:P},{type:a.TokenHelperService}]},e}();var re=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[null!=t?{provide:b,useValue:t}:[],U,j,B]}},e.decorators=[{type:t.NgModule,args:[{imports:[s.HttpClientModule,a.AngularSimpleOidcCoreModule,ne],providers:[E,w,P,G,$,Z,Y,Q,X,ee,te],declarations:[],exports:[a.AngularSimpleOidcCoreModule]}]}],e}();var oe=function(){function e(e,t){var r=this;this.auth=e,this.events=t,this.destroyedSubject=new n.Subject,this.auth.events$.pipe(c.filterInstanceOf(z),o.switchMap(function(){return r.auth.refreshAccessToken()}),o.takeUntil(this.destroyedSubject)).subscribe()}return e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.decorators=[{type:t.NgModule,args:[{imports:[],providers:[],declarations:[]}]}],e.ctorParameters=function(){return[{type:ee},{type:i.EventsService}]},e}();var ie=function(e){function t(t){return e.call(this,"Session check not supported by OP: check_session_iframe on discovery document and session_state are required","session-check-not-supported",t)||this}return p(t,e),t}(a.SimpleOidcError),ae=function(e){function t(t){return e.call(this,"OP iframe returned error. According to spec, message malformed?","session-check-error",t)||this}return p(t,e),t}(a.SimpleOidcError),se=function(e){function t(t){return e.call(this,"Iframe failed to postMessage back in given time.","iframe-post-message-timeout",t)||this}return p(t,e),t}(a.SimpleOidcError),ce=function(e){function t(){return e.call(this,"Expected SESSION_MANAGEMENT_CONFIG to be in Injector.\nYou need to provide a configuration either with SessionManagementModule.forRoot() or by adding your own (Observable<SessionManagementConfig> | SessionManagementConfig) into the injector with the SESSION_MANAGEMENT_CONFIG injection token.","session-management-config-missing",null)||this}return p(t,e),t}(a.SimpleOidcError),ue=function(e){function t(){return e.call(this,"Session has changed.")||this}return p(t,e),t}(i.SimpleOidcInfoEvent),pe=function(e){function t(t){return e.call(this,"Session has been terminated.",t)||this}return p(t,e),t}(i.SimpleOidcInfoEvent),de=["iframePath"];var le=new t.InjectionToken("SESSION_MANAGEMENT_CONFIG_SERVICE"),he=new t.InjectionToken("SESSION_MANAGEMENT_CONFIG"),fe={opIframePollInterval:1e3,iframeTimeout:1e4};function ve(e,t,r){if(!e)throw new ce;var i=n.isObservable(e)?e:n.of(e);return function(){return i.pipe(o.tap(function(e){return t.configure(e,{defaultConfig:fe,requiredFields:de})}),o.catchError(function(e){return console.error("Callback failed in SESSION_MANAGEMENT_CONFIG_INITIALIZER"),console.error(e),r.dispatchError(e),n.of(null)})).toPromise()}}var ge={multi:!0,provide:t.APP_INITIALIZER,deps:[[new t.Optional,he],le,i.EventsService],useFactory:ve},ke={provide:le,useClass:r.ConfigService},ye=function(){function e(e,t,r,o,i,a,s){this.window=e,this.discoveryClient=t,this.dynamicIframe=r,this.tokenStorage=o,this.config=i,this.sessionConfig=a,this.events=s,this.destroyedSubject=new n.Subject}return e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.prototype.startSessionCheck=function(){var e=this,t=this.tokenStorage.currentState$.pipe(o.take(1)),r=this.discoveryClient.current$.pipe(o.take(1)),a=this.dynamicIframe.create().hide();return n.combineLatest(r,t).pipe(o.tap(function(){return e.events.dispatch(new i.SimpleOidcInfoEvent("Starting Session Check"))}),o.map(function(e){var t=h(e,2),n=t[0],r=t[1];if(n.check_session_iframe&&r.sessionState)return a.setSource(n.check_session_iframe).appendToBody(),r;throw new ie({doc:n,localState:r})}),o.withLatestFrom(this.config.current$,this.sessionConfig.current$),o.take(1),o.switchMap(function(t){var r=h(t,3),i=r[0],s=r[1],c=r[2],u=new URL(s.openIDProviderUrl).origin,p=n.interval(c.opIframePollInterval).pipe(o.map(function(){return s.clientId.toLowerCase()+" "+i.sessionState}),o.tap(function(e){return a.postMessage(e,u)})),d=n.fromEvent(e.window,"message").pipe(o.filter(function(e){return e.origin===u}),o.map(function(t){return e.fireEventsFromMessage(t)}),o.filter(function(e){return!!e}));return n.combineLatest(p,d).pipe(o.map(function(e){return e[1]}))}),o.finalize(function(){return a.remove()}),o.takeUntil(this.destroyedSubject.asObservable()))},e.prototype.fireEventsFromMessage=function(e){var t=e.data;switch(t){case"changed":return this.events.dispatch(new ue),t;case"unchanged":return t;case"error":throw new ae(e);default:return null}},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:$},{type:q},{type:P},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:r.ConfigService,decorators:[{type:t.Inject,args:[le]}]},{type:i.EventsService}]},e}();var Se=function(){function e(e,t,n,r,o,i,a,s,c){this.window=e,this.discoveryClient=t,this.dynamicIframe=n,this.tokenStorage=r,this.authConfig=o,this.sessionConfig=i,this.events=a,this.oidcClient=s,this.tokenUrl=c}return e.prototype.startCodeFlowInIframe=function(){var e=this,t=this.authConfig.current$.pipe(o.withLatestFrom(this.sessionConfig.current$),o.map(function(e){var t=h(e,2),n=t[0],r=t[1];return N(n.baseUrl,r.iframePath)}));return this.tokenStorage.currentState$.pipe(o.take(1),o.tap(function(){return e.events.dispatch(new i.SimpleOidcInfoEvent("Starting Code Flow in iframe"))}),o.withLatestFrom(t),o.switchMap(function(t){var n=h(t,2),r=n[0].identityToken,i=n[1];return e.oidcClient.generateCodeFlowMetadata({redirectUri:i,prompt:"none",idTokenHint:r}).pipe(o.map(function(e){return{metadata:e,iframeUrl:i}}))}),o.withLatestFrom(this.sessionConfig.current$),o.take(1),o.switchMap(function(t){var r=h(t,2),a=r[0],s=a.metadata,c=a.iframeUrl,u=r[1];e.events.dispatch(new i.SimpleOidcInfoEvent("Creating iframe",s));var p=e.dynamicIframe.create().hide().setSource(s.url).appendToBody();return n.fromEvent(e.window,"message").pipe(o.map(function(e){return{event:e,iframe:p,metadata:s,iframeUrl:c}}),o.filter(function(e){return e.event.data.startsWith(c)}),o.take(1),o.timeout(u.iframeTimeout),o.catchError(function(e){if(e.name&&"TimeoutError"===e.name)throw new se({iframe:p,e:e});return n.throwError(e)}))}),o.map(function(t){var n=t.event,r=t.iframe,o=t.metadata,a=t.iframeUrl,s=n.data;return e.events.dispatch(new i.SimpleOidcInfoEvent("Obtained data from iframe",{event:n,href:s})),r.remove(),{href:s,iframeUrl:a,metadata:o}}),o.switchMap(function(t){var n=t.href,r=t.iframeUrl,o=t.metadata;return e.oidcClient.codeFlowCallback(n,r,o)}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:$},{type:q},{type:P},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:r.ConfigService,decorators:[{type:t.Inject,args:[le]}]},{type:i.EventsService},{type:Z},{type:a.TokenUrlService}]},e}();var me=function(){function e(e,t,r,a){var s=this;this.sessionCheck=e,this.events=t,this.authorizeSilentClient=r,this.tokenStorage=a,this.destroyedSubject=new n.Subject;var u=this.events.events$.pipe(c.filterInstanceOf(ue));this.events.events$.pipe(c.filterInstanceOf(V),o.switchMap(function(){return s.sessionCheck.startSessionCheck().pipe(o.takeUntil(u))}),o.takeUntil(this.destroyedSubject)).subscribe();var p=this.tokenStorage.currentState$.pipe(o.take(1),o.switchMap(function(e){return s.authorizeSilentClient.startCodeFlowInIframe().pipe(o.map(function(t){return{result:t,previousState:e}}))}),o.tap(function(e){var t=e.result,n=e.previousState,r=t.decodedIdToken,o=n.decodedIdentityToken;o&&r.sub!==o.sub&&s.events.dispatch(new pe({previousToken:o,newToken:r}))}),o.catchError(function(e){return s.events.dispatch(new pe({error:e.context})),n.of(null)}));this.events.events$.pipe(c.filterInstanceOf(ue),o.tap(function(){return s.events.dispatch(new i.SimpleOidcInfoEvent("Session has changed. Starting silent code flow."))}),o.switchMap(function(){return p}),o.takeUntil(this.destroyedSubject)).subscribe()}return e.forRoot=function(t){return{ngModule:e,providers:[null!=t?{provide:he,useValue:t}:[],ke,ge]}},e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.decorators=[{type:t.NgModule,args:[{imports:[],providers:[ye,Se],declarations:[]}]}],e.ctorParameters=function(){return[{type:ye},{type:i.EventsService},{type:Se},{type:P}]},e}();var Ie=function(e){function t(t){return e.call(this,"Child window has been closed, no response was received","child-window-closed",t)||this}return p(t,e),t}(a.SimpleOidcError),we=function(e){function t(){return e.call(this,"Expected POPUP_AUTHORIZATION_CONFIG to be in Injector.\nYou need to provide a configuration either with PopupAuthorizationModule.forRoot() or by adding your own (Observable<PopupAuthorizationConfig> | PopupAuthorizationConfig) into the injector with the POPUP_AUTHORIZATION_CONFIG injection token.","popup-authorization-config-missing",null)||this}return p(t,e),t}(a.SimpleOidcError),Te=["childWindowPath"];var Ee=new t.InjectionToken("POPUP_AUTHORIZATION_CONFIG_SERVICE"),Ce=new t.InjectionToken("POPUP_AUTHORIZATION_CONFIG"),be={};function Oe(e,t,r){if(!e)throw new we;var i=n.isObservable(e)?e:n.of(e);return function(){return i.pipe(o.tap(function(e){return t.configure(e,{defaultConfig:be,requiredFields:Te})}),o.catchError(function(e){return console.error("Callback failed in POPUP_AUTHORIZATION_CONFIG_INITIALIZER"),console.error(e),r.dispatchError(e),n.of(null)})).toPromise()}}var Ae={multi:!0,provide:t.APP_INITIALIZER,deps:[[new t.Optional,Ce],Ee,i.EventsService],useFactory:Oe},je={provide:Ee,useClass:r.ConfigService},Ue=function(){function e(e,t,r,o,i,a,s){this.window=e,this.tokenStorage=t,this.authConfig=r,this.popupConfig=o,this.events=i,this.oidcClient=a,this.tokenUrl=s,this.destroyedSubject=new n.Subject}return e.prototype.startCodeFlowInPopup=function(e){var t=this;return void 0===e&&(e={}),this.authConfig.current$.pipe(o.withLatestFrom(this.popupConfig.current$),o.map(function(e){var t=h(e,2),n=t[0],r=t[1];return N(n.baseUrl,r.childWindowPath)}),o.take(1)).pipe(o.tap(function(){return t.events.dispatch(new i.SimpleOidcInfoEvent("Starting Code Flow in child window"))}),o.switchMap(function(e){return t.oidcClient.generateCodeFlowMetadata({redirectUri:e,display:"popup"}).pipe(o.map(function(t){return{metadata:t,redirectUri:e}}))}),o.take(1),o.switchMap(function(r){var a=r.metadata,s=r.redirectUri;t.events.dispatch(new i.SimpleOidcInfoEvent("Creating window",a));var c=t.window.open(a.url,"_blank",t.calculatePopupFeatures(e)),u=n.interval(500).pipe(o.tap(function(){return console.info("polling")}),o.filter(function(){return c.closed}),o.tap(function(){return t.events.dispatch(new i.SimpleOidcInfoEvent("Child Window has been closed"))}),o.tap(function(){throw new Ie({metadata:a,redirectUri:s})}),o.take(1));return n.fromEvent(t.window,"message").pipe(o.map(function(e){return{event:e,handle:c,metadata:a,redirectUri:s}}),o.filter(function(e){var t=e.event;return t.data&&"string"==typeof t.data}),o.filter(function(e){return e.event.data.startsWith(s)}),o.take(1),o.takeUntil(u))}),o.map(function(e){var n=e.event,r=e.handle,o=e.metadata,a=e.redirectUri,s=n.data;return t.events.dispatch(new i.SimpleOidcInfoEvent("Obtained data from window",{event:n,href:s})),r.close(),{href:s,metadata:o,redirectUri:a}}),o.switchMap(function(e){var n=e.href,r=e.redirectUri,o=e.metadata;return t.oidcClient.codeFlowCallback(n,r,o)}),o.takeUntil(this.destroyedSubject))},e.prototype.ngOnDestroy=function(){this.destroyedSubject.next(),this.destroyedSubject.complete()},e.prototype.calculatePopupFeatures=function(e){var t=e.height||660,n=e.width||500,r=this.window.screen,o=r.width/2-n/2;return"location=no,toolbar=no,width="+n+",height="+t+",top="+(r.height/2-t/2)+",left="+o},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:Window,decorators:[{type:t.Inject,args:[S]}]},{type:P},{type:r.ConfigService,decorators:[{type:t.Inject,args:[C]}]},{type:r.ConfigService,decorators:[{type:t.Inject,args:[Ee]}]},{type:i.EventsService},{type:Z},{type:a.TokenUrlService}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(S),t.ɵɵinject(P),t.ɵɵinject(C),t.ɵɵinject(Ee),t.ɵɵinject(i.EventsService),t.ɵɵinject(Z),t.ɵɵinject(a.TokenUrlService))},token:e,providedIn:"root"}),e}();var Pe=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[null!=t?{provide:Ce,useValue:t}:[],je,Ae]}},e.decorators=[{type:t.NgModule,args:[{imports:[],providers:[Ue],declarations:[]}]}],e}();e.AUTH_CONFIG=b,e.AUTH_CONFIG_SERVICE=C,e.AccessTokenExpiredEvent=H,e.AccessTokenExpiringEvent=z,e.AngularSimpleOidcModule=re,e.AuthGuard=te,e.AuthService=ee,e.AuthenticationConfigurationMissingError=k,e.AuthorizeEndpointPopupClientService=Ue,e.AuthorizeEndpointSilentClientService=Se,e.AutomaticRefreshModule=oe,e.ChildWindowClosedError=Ie,e.DiscoveryDocumentObtainedEvent=x,e.EndSessionClientService=Q,e.IframePostMessageTimeoutError=se,e.LOCAL_STORAGE_REF=m,e.OidcCodeFlowClient=Z,e.OidcDiscoveryDocClient=$,e.POPUP_AUTHORIZATION_CONFIG=Ce,e.POPUP_AUTHORIZATION_CONFIG_REQUIRED_FIELDS=Te,e.POPUP_AUTHORIZATION_CONFIG_SERVICE=Ee,e.PopupAuthorizationConfigurationMissingError=we,e.PopupAuthorizationModule=Pe,e.RefreshTokenClient=Y,e.SESSION_MANAGEMENT_CONFIG=he,e.SESSION_MANAGEMENT_CONFIG_REQUIRED_FIELDS=de,e.SESSION_MANAGEMENT_CONFIG_SERVICE=le,e.SessionChangedEvent=ue,e.SessionCheckFailedError=ae,e.SessionCheckNotSupportedError=ie,e.SessionCheckService=ye,e.SessionManagementConfigurationMissingError=ce,e.SessionManagementModule=me,e.SessionTerminatedEvent=pe,e.TokenEndpointError=g,e.TokenEndpointUnexpectedError=v,e.TokenStorageService=P,e.TokensObtainedEvent=D,e.TokensReadyEvent=V,e.TokensValidatedEvent=L,e.UserInfoNotSupportedError=y,e.UserInfoObtainedEvent=K,e.WINDOW_REF=S,e.ɵa=I,e.ɵb=w,e.ɵc=T,e.ɵd=E,e.ɵe=A,e.ɵf=j,e.ɵg=U,e.ɵh=ve,e.ɵi=ge,e.ɵj=ke,e.ɵk=Oe,e.ɵl=Ae,e.ɵm=je,e.ɵn=ne,e.ɵo=G,e.ɵp=q,e.ɵq=X,e.ɵr=J,e.ɵs=B,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=angular-simple-oidc.umd.min.js.map |
@@ -68,3 +68,6 @@ /** | ||
remove() { | ||
(/** @type {?} */ (this)).handle.parentElement.removeChild((/** @type {?} */ (this)).handle); | ||
// iframe may not have been appended. | ||
if ((/** @type {?} */ (this)).handle.parentElement) { | ||
(/** @type {?} */ (this)).handle.parentElement.removeChild((/** @type {?} */ (this)).handle); | ||
} | ||
return (/** @type {?} */ (this)); | ||
@@ -82,2 +85,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHluYW1pYy1pZnJhbWUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9hbmd1bGFyLXNpbXBsZS1vaWRjLyIsInNvdXJjZXMiOlsibGliL2R5bmFtaWMtaWZyYW1lL2R5bmFtaWMtaWZyYW1lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFDQSxNQUFNLE9BQU8sYUFBYTs7OztJQUl0QixZQUErQixRQUFrQjtRQUFsQixhQUFRLEdBQVIsUUF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luKTtcclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH1cclxuXHJcbiAgICBwdWJsaWMgcmVtb3ZlKCkge1xyXG4gICAgICAgIC8vIGlmcmFtZSBtYXkgbm90IGhhdmUgYmVlbiBhcHBlbmRlZC5cclxuICAgICAgICBpZiAodGhpcy5oYW5kbGUucGFyZW50RWxlbWVudCkge1xyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZS5wYXJlbnRFbGVtZW50LnJlbW92ZUNoaWxkKHRoaXMuaGFuZGxlKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHRoaXM7XHJcbiAgICB9XHJcbn1cclxuIl19 |
@@ -99,3 +99,6 @@ /** | ||
function () { | ||
(/** @type {?} */ (this)).handle.parentElement.removeChild((/** @type {?} */ (this)).handle); | ||
// iframe may not have been appended. | ||
if ((/** @type {?} */ (this)).handle.parentElement) { | ||
(/** @type {?} */ (this)).handle.parentElement.removeChild((/** @type {?} */ (this)).handle); | ||
} | ||
return (/** @type {?} */ (this)); | ||
@@ -115,2 +118,2 @@ }; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHluYW1pYy1pZnJhbWUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9hbmd1bGFyLXNpbXBsZS1vaWRjLyIsInNvdXJjZXMiOlsibGliL2R5bmFtaWMtaWZyYW1lL2R5bmFtaWMtaWZyYW1lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFDQTtJQUlJLHVCQUErQixRQUFrQjtRQUFsQixhQUFRLEdBQVIsUUFBUSxDQUFVO1FBQzdDLElBQUksQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxhQUFhLENBQUMsUUFBUSxDQUFDLENBQUM7SUFDeEQsQ0FBQzs7Ozs7OztJQUVNLGdDQUFROzs7Ozs7SUFBZixVQUFnQixDQUFjO1FBQzFCLENBQUMsQ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AgICAgICB0aGlzLmhhbmRsZS5jb250ZW50V2luZG93LnBvc3RNZXNzYWdlKG1zZywgb3JpZ2luKTtcclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH1cclxuXHJcbiAgICBwdWJsaWMgcmVtb3ZlKCkge1xyXG4gICAgICAgIC8vIGlmcmFtZSBtYXkgbm90IGhhdmUgYmVlbiBhcHBlbmRlZC5cclxuICAgICAgICBpZiAodGhpcy5oYW5kbGUucGFyZW50RWxlbWVudCkge1xyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZS5wYXJlbnRFbGVtZW50LnJlbW92ZUNoaWxkKHRoaXMuaGFuZGxlKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHRoaXM7XHJcbiAgICB9XHJcbn1cclxuIl19 |
{ | ||
"name": "angular-simple-oidc", | ||
"version": "8.1.2", | ||
"version": "8.1.3", | ||
"description": "Angular Library implementing Open Id Connect specification. Code Flow, Refresh Tokens, Session Management, Discovery Document.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2893343
29454