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

angular-auth-oidc-client

Package Overview
Dependencies
Maintainers
3
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-auth-oidc-client - npm Package Compare versions

Comparing version 1.3.19 to 2.0.0

4

bundles/angular-auth-oidc-client.umd.min.js

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

!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/common"),require("@angular/http"),require("rxjs/add/operator/map"),require("rxjs/add/operator/catch"),require("rxjs/add/operator/timeInterval"),require("rxjs/add/operator/pluck"),require("rxjs/add/operator/take"),require("rxjs/add/observable/interval"),require("rxjs/add/observable/timer"),require("rxjs/Observable"),require("rxjs/BehaviorSubject"),require("@angular/router"),require("jsrsasign"),require("rxjs/add/observable/throw"),require("rxjs/add/observable/empty")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/http","rxjs/add/operator/map","rxjs/add/operator/catch","rxjs/add/operator/timeInterval","rxjs/add/operator/pluck","rxjs/add/operator/take","rxjs/add/observable/interval","rxjs/add/observable/timer","rxjs/Observable","rxjs/BehaviorSubject","@angular/router","jsrsasign","rxjs/add/observable/throw","rxjs/add/observable/empty"],factory):factory((global.ng=global.ng||{},global.ng.angularAuthOidcClient=global.ng.angularAuthOidcClient||{}),global.ng.core,global.ng.common,global.ng.http,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable,global.Rx.Observable,global.Rx,global.Rx,global.ng.router,global.jsrsasign)}(this,function(exports,_angular_core,_angular_common,_angular_http,rxjs_add_operator_map,rxjs_add_operator_catch,rxjs_add_operator_timeInterval,rxjs_add_operator_pluck,rxjs_add_operator_take,rxjs_add_observable_interval,rxjs_add_observable_timer,rxjs_Observable,rxjs_BehaviorSubject,_angular_router,jsrsasign){"use strict";var DefaultConfiguration=function(){function DefaultConfiguration(){this.stsServer="https://localhost:44318",this.redirect_url="https://localhost:44311",this.client_id="angularclient",this.response_type="id_token token",this.resource="",this.scope="openid email profile",this.hd_param="",this.post_logout_redirect_uri="https://localhost:44311/unauthorized",this.start_checksession=!1,this.silent_renew=!0,this.silent_renew_offset_in_seconds=0,this.startup_route="/dataeventrecords",this.forbidden_route="/forbidden",this.unauthorized_route="/unauthorized",this.auto_userinfo=!0,this.log_console_warning_active=!0,this.log_console_debug_active=!1,this.max_id_token_iat_offset_allowed_in_seconds=3,this.override_well_known_configuration=!1,this.override_well_known_configuration_url="https://localhost:44386/wellknownconfiguration.json",this.storage="undefined"!=typeof Storage?sessionStorage:null}return DefaultConfiguration}(),OpenIDImplicitFlowConfiguration=function(){function OpenIDImplicitFlowConfiguration(){}return OpenIDImplicitFlowConfiguration}(),AuthConfiguration=function(){function AuthConfiguration(defaultConfig){this.defaultConfig=defaultConfig}return Object.defineProperty(AuthConfiguration.prototype,"stsServer",{get:function(){return this.openIDImplicitFlowConfiguration.stsServer||this.defaultConfig.stsServer},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"redirect_url",{get:function(){return this.openIDImplicitFlowConfiguration.redirect_url||this.defaultConfig.redirect_url},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"client_id",{get:function(){return this.openIDImplicitFlowConfiguration.client_id||this.defaultConfig.client_id},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"response_type",{get:function(){return this.openIDImplicitFlowConfiguration.response_type||this.defaultConfig.response_type},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"resource",{get:function(){return this.openIDImplicitFlowConfiguration.resource||this.defaultConfig.resource},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"scope",{get:function(){return this.openIDImplicitFlowConfiguration.scope||this.defaultConfig.scope},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"hd_param",{get:function(){return this.openIDImplicitFlowConfiguration.hd_param||this.defaultConfig.hd_param},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"post_logout_redirect_uri",{get:function(){return this.openIDImplicitFlowConfiguration.post_logout_redirect_uri||this.defaultConfig.post_logout_redirect_uri},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"start_checksession",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.start_checksession?this.openIDImplicitFlowConfiguration.start_checksession:this.defaultConfig.start_checksession},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"silent_renew",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.silent_renew?this.openIDImplicitFlowConfiguration.silent_renew:this.defaultConfig.silent_renew},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"silent_renew_offset_in_seconds",{get:function(){return this.openIDImplicitFlowConfiguration.silent_renew_offset_in_seconds||this.defaultConfig.silent_renew_offset_in_seconds},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"startup_route",{get:function(){return this.openIDImplicitFlowConfiguration.startup_route||this.defaultConfig.startup_route},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"forbidden_route",{get:function(){return this.openIDImplicitFlowConfiguration.forbidden_route||this.defaultConfig.forbidden_route},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"unauthorized_route",{get:function(){return this.openIDImplicitFlowConfiguration.unauthorized_route||this.defaultConfig.unauthorized_route},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"auto_userinfo",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.auto_userinfo?this.openIDImplicitFlowConfiguration.auto_userinfo:this.defaultConfig.auto_userinfo},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"auto_clean_state_after_authentication",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.auto_clean_state_after_authentication?this.openIDImplicitFlowConfiguration.auto_clean_state_after_authentication:this.defaultConfig.auto_clean_state_after_authentication},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"trigger_authorization_result_event",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.trigger_authorization_result_event?this.openIDImplicitFlowConfiguration.trigger_authorization_result_event:this.defaultConfig.trigger_authorization_result_event},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"log_console_warning_active",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.log_console_warning_active?this.openIDImplicitFlowConfiguration.log_console_warning_active:this.defaultConfig.log_console_warning_active},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"log_console_debug_active",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.log_console_debug_active?this.openIDImplicitFlowConfiguration.log_console_debug_active:this.defaultConfig.log_console_debug_active},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"max_id_token_iat_offset_allowed_in_seconds",{get:function(){return this.openIDImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds||this.defaultConfig.max_id_token_iat_offset_allowed_in_seconds},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"override_well_known_configuration",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.override_well_known_configuration?this.openIDImplicitFlowConfiguration.override_well_known_configuration:this.defaultConfig.override_well_known_configuration},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"override_well_known_configuration_url",{get:function(){return this.openIDImplicitFlowConfiguration.override_well_known_configuration_url||this.defaultConfig.override_well_known_configuration_url},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"storage",{get:function(){return this.openIDImplicitFlowConfiguration.storage||this.defaultConfig.storage},enumerable:!0,configurable:!0}),AuthConfiguration.prototype.init=function(openIDImplicitFlowConfiguration){this.openIDImplicitFlowConfiguration=openIDImplicitFlowConfiguration},AuthConfiguration}();AuthConfiguration.decorators=[{type:_angular_core.Injectable}],AuthConfiguration.ctorParameters=function(){return[{type:DefaultConfiguration}]};var OidcSecurityStorage=function(){function OidcSecurityStorage(){}return OidcSecurityStorage.prototype.read=function(key){},OidcSecurityStorage.prototype.write=function(key,value){},OidcSecurityStorage}();OidcSecurityStorage.decorators=[{type:_angular_core.Injectable}],OidcSecurityStorage.ctorParameters=function(){return[]};var BrowserStorage=function(){function BrowserStorage(authConfiguration){this.authConfiguration=authConfiguration,this.hasStorage="undefined"!=typeof Storage}return BrowserStorage.prototype.read=function(key){if(this.hasStorage)return JSON.parse(this.authConfiguration.storage.getItem(key))},BrowserStorage.prototype.write=function(key,value){this.hasStorage&&(value=void 0===value?null:value,this.authConfiguration.storage.setItem(key,JSON.stringify(value)))},BrowserStorage}();BrowserStorage.decorators=[{type:_angular_core.Injectable}],BrowserStorage.ctorParameters=function(){return[{type:AuthConfiguration}]};var OidcSecurityCommon=function(){function OidcSecurityCommon(authConfiguration,oidcSecurityStorage){this.authConfiguration=authConfiguration,this.oidcSecurityStorage=oidcSecurityStorage,this.storage_auth_result="authorizationResult",this.storage_access_token="authorizationData",this.storage_id_token="authorizationDataIdToken",this.storage_is_authorized="_isAuthorized",this.storage_user_data="userData",this.storage_auth_nonce="authNonce",this.storage_auth_state_control="authStateControl",this.storage_well_known_endpoints="wellknownendpoints",this.storage_session_state="session_state",this.storage_silent_renew_running="storage_silent_renew_running",this.storage_custom_request_params="storage_custom_request_params"}return OidcSecurityCommon.prototype.setupModule=function(){},OidcSecurityCommon.prototype.retrieve=function(key){return this.oidcSecurityStorage.read(key)},OidcSecurityCommon.prototype.store=function(key,value){this.oidcSecurityStorage.write(key,value)},OidcSecurityCommon.prototype.resetStorageData=function(isRenewProcess){isRenewProcess||(this.store(this.storage_auth_result,""),this.store(this.storage_session_state,""),this.store(this.storage_silent_renew_running,""),this.store(this.storage_is_authorized,!1),this.store(this.storage_access_token,""),this.store(this.storage_id_token,""),this.store(this.storage_user_data,""))},OidcSecurityCommon.prototype.getAccessToken=function(){return this.retrieve(this.storage_access_token)},OidcSecurityCommon.prototype.getIdToken=function(){return this.retrieve(this.storage_id_token)},OidcSecurityCommon.prototype.logError=function(message){console.error(message)},OidcSecurityCommon.prototype.logWarning=function(message){this.authConfiguration.log_console_warning_active&&console.warn(message)},OidcSecurityCommon.prototype.logDebug=function(message){this.authConfiguration.log_console_debug_active&&console.log(message)},OidcSecurityCommon}();OidcSecurityCommon.decorators=[{type:_angular_core.Injectable}],OidcSecurityCommon.ctorParameters=function(){return[{type:AuthConfiguration},{type:OidcSecurityStorage}]};var OidcSecurityValidation=function(){function OidcSecurityValidation(oidcSecurityCommon){this.oidcSecurityCommon=oidcSecurityCommon}return OidcSecurityValidation.prototype.isTokenExpired=function(token,offsetSeconds){var decoded;return decoded=this.getPayloadFromToken(token,!1),!this.validate_id_token_exp_not_expired(decoded,offsetSeconds)},OidcSecurityValidation.prototype.validate_id_token_exp_not_expired=function(decoded_id_token,offsetSeconds){var tokenExpirationDate=this.getTokenExpirationDate(decoded_id_token);return offsetSeconds=offsetSeconds||0,null!=tokenExpirationDate&&tokenExpirationDate.valueOf()>(new Date).valueOf()+1e3*offsetSeconds},OidcSecurityValidation.prototype.validate_required_id_token=function(dataIdToken){var validated=!0;return dataIdToken.hasOwnProperty("iss")||(validated=!1,this.oidcSecurityCommon.logWarning("iss is missing, this is required in the id_token")),dataIdToken.hasOwnProperty("sub")||(validated=!1,this.oidcSecurityCommon.logWarning("sub is missing, this is required in the id_token")),dataIdToken.hasOwnProperty("aud")||(validated=!1,this.oidcSecurityCommon.logWarning("aud is missing, this is required in the id_token")),dataIdToken.hasOwnProperty("exp")||(validated=!1,this.oidcSecurityCommon.logWarning("exp is missing, this is required in the id_token")),dataIdToken.hasOwnProperty("iat")||(validated=!1,this.oidcSecurityCommon.logWarning("iat is missing, this is required in the id_token")),validated},OidcSecurityValidation.prototype.validate_id_token_iat_max_offset=function(dataIdToken,max_offset_allowed_in_seconds){if(!dataIdToken.hasOwnProperty("iat"))return!1;var dateTime_iat_id_token=new Date(0);return dateTime_iat_id_token.setUTCSeconds(dataIdToken.iat),max_offset_allowed_in_seconds=max_offset_allowed_in_seconds||0,null!=dateTime_iat_id_token&&(this.oidcSecurityCommon.logDebug("validate_id_token_iat_max_offset: "+((new Date).valueOf()-dateTime_iat_id_token.valueOf())+" < "+1e3*max_offset_allowed_in_seconds),(new Date).valueOf()-dateTime_iat_id_token.valueOf()<1e3*max_offset_allowed_in_seconds)},OidcSecurityValidation.prototype.validate_id_token_nonce=function(dataIdToken,local_nonce){return dataIdToken.nonce===local_nonce||(this.oidcSecurityCommon.logDebug("Validate_id_token_nonce failed, dataIdToken.nonce: "+dataIdToken.nonce+" local_nonce:"+local_nonce),!1)},OidcSecurityValidation.prototype.validate_id_token_iss=function(dataIdToken,authWellKnownEndpoints_issuer){return dataIdToken.iss==authWellKnownEndpoints_issuer||(this.oidcSecurityCommon.logDebug("Validate_id_token_iss failed, dataIdToken.iss: "+dataIdToken.iss+" authWellKnownEndpoints issuer:"+authWellKnownEndpoints_issuer),!1)},OidcSecurityValidation.prototype.validate_id_token_aud=function(dataIdToken,aud){return dataIdToken.aud==aud||(this.oidcSecurityCommon.logDebug("Validate_id_token_aud failed, dataIdToken.aud: "+dataIdToken.aud+" client_id:"+aud),!1)},OidcSecurityValidation.prototype.validateStateFromHashCallback=function(state,local_state){return state==local_state||(this.oidcSecurityCommon.logDebug("ValidateStateFromHashCallback failed, state: "+state+" local_state:"+local_state),!1)},OidcSecurityValidation.prototype.validate_userdata_sub_id_token=function(id_token_sub,userdata_sub){return id_token_sub==userdata_sub||(this.oidcSecurityCommon.logDebug("validate_userdata_sub_id_token failed, id_token_sub: "+id_token_sub+" userdata_sub:"+userdata_sub),!1)},OidcSecurityValidation.prototype.getPayloadFromToken=function(token,encode){var data={};if(void 0!==token){var encoded=token.split(".")[1];if(encode)return encoded;data=JSON.parse(this.urlBase64Decode(encoded))}return data},OidcSecurityValidation.prototype.getHeaderFromToken=function(token,encode){var data={};if(void 0!==token){var encoded=token.split(".")[0];if(encode)return encoded;data=JSON.parse(this.urlBase64Decode(encoded))}return data},OidcSecurityValidation.prototype.getSignatureFromToken=function(token,encode){var data={};if(void 0!==token){var encoded=token.split(".")[2];if(encode)return encoded;data=JSON.parse(this.urlBase64Decode(encoded))}return data},OidcSecurityValidation.prototype.validate_signature_id_token=function(id_token,jwtkeys){if(!jwtkeys||!jwtkeys.keys)return!1;var header_data=this.getHeaderFromToken(id_token,!1);if(0===Object.keys(header_data).length&&header_data.constructor===Object)return this.oidcSecurityCommon.logWarning("id token has no header data"),!1;var kid=header_data.kid;if("RS256"!=header_data.alg)return this.oidcSecurityCommon.logWarning("Only RS256 supported"),!1;var isValid=!1;if(header_data.hasOwnProperty("kid"))for(var _d=0,_e=jwtkeys.keys;_d<_e.length;_d++){var key=_e[_d];if(key.kid==kid){var publickey=jsrsasign.KEYUTIL.getKey(key);return isValid=jsrsasign.KJUR.jws.JWS.verify(id_token,publickey,["RS256"]),isValid||this.oidcSecurityCommon.logWarning("incorrect Signature, validation failed for id_token"),isValid}}else{for(var amountOfMatchingKeys=0,_i=0,_a=jwtkeys.keys;_i<_a.length;_i++){var key=_a[_i];"RSA"==key.kty&&"sig"==key.use&&(amountOfMatchingKeys+=1)}if(0==amountOfMatchingKeys)return this.oidcSecurityCommon.logWarning("no keys found, incorrect Signature, validation failed for id_token"),!1;if(amountOfMatchingKeys>1)return this.oidcSecurityCommon.logWarning("no ID Token kid claim in JOSE header and multiple supplied in jwks_uri"),!1;for(var _b=0,_c=jwtkeys.keys;_b<_c.length;_b++){var key=_c[_b];if("RSA"==key.kty&&"sig"==key.use){var publickey=jsrsasign.KEYUTIL.getKey(key);return isValid=jsrsasign.KJUR.jws.JWS.verify(id_token,publickey,["RS256"]),isValid||this.oidcSecurityCommon.logWarning("incorrect Signature, validation failed for id_token"),isValid}}}return isValid},OidcSecurityValidation.prototype.config_validate_response_type=function(response_type){return"id_token token"===response_type||"id_token"===response_type||(this.oidcSecurityCommon.logWarning("module configure incorrect, invalid response_type:"+response_type),!1)},OidcSecurityValidation.prototype.validate_id_token_at_hash=function(access_token,at_hash){this.oidcSecurityCommon.logDebug("From the server:"+at_hash);var testdata=this.generate_at_hash(""+access_token);if(this.oidcSecurityCommon.logDebug("client validation not decoded:"+testdata),testdata==at_hash)return!0;var testValue=this.generate_at_hash(""+decodeURIComponent(access_token));return this.oidcSecurityCommon.logDebug("-gen access--"+testValue),testValue==at_hash},OidcSecurityValidation.prototype.generate_at_hash=function(access_token){var hash=jsrsasign.KJUR.crypto.Util.hashString(access_token,"sha256"),first128bits=hash.substr(0,hash.length/2);return jsrsasign.hextob64u(first128bits)},OidcSecurityValidation.prototype.getTokenExpirationDate=function(dataIdToken){if(!dataIdToken.hasOwnProperty("exp"))return new Date;var date=new Date(0);return date.setUTCSeconds(dataIdToken.exp),date},OidcSecurityValidation.prototype.urlBase64Decode=function(str){var output=str.replace("-","+").replace("_","/");switch(output.length%4){case 0:break;case 2:output+="==";break;case 3:output+="=";break;default:throw"Illegal base64url string!"}return window.atob(output)},OidcSecurityValidation}();OidcSecurityValidation.decorators=[{type:_angular_core.Injectable}],OidcSecurityValidation.ctorParameters=function(){return[{type:OidcSecurityCommon}]};var AuthWellKnownEndpoints=function(){function AuthWellKnownEndpoints(http,authConfiguration,oidcSecurityCommon){var _this=this;this.http=http,this.authConfiguration=authConfiguration,this.oidcSecurityCommon=oidcSecurityCommon,this.onWellKnownEndpointsLoaded=new _angular_core.EventEmitter(!0),this.getWellKnownEndpoints=function(){var headers=new _angular_http.Headers;headers.append("Accept","application/json");var url=_this.authConfiguration.stsServer+"/.well-known/openid-configuration";return _this.authConfiguration.override_well_known_configuration&&(url=_this.authConfiguration.override_well_known_configuration_url),_this.http.get(url,{headers:headers}).map(function(res){return res.json()})}}return AuthWellKnownEndpoints.prototype.setupModule=function(){var _this=this,data=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_well_known_endpoints);this.oidcSecurityCommon.logDebug(data),data&&""!==data?(this.oidcSecurityCommon.logDebug("AuthWellKnownEndpoints already defined"),this.issuer=data.issuer,this.jwks_uri=data.jwks_uri,this.authorization_endpoint=data.authorization_endpoint,this.token_endpoint=data.token_endpoint,this.userinfo_endpoint=data.userinfo_endpoint,data.end_session_endpoint&&(this.end_session_endpoint=data.end_session_endpoint),data.check_session_iframe&&(this.check_session_iframe=data.check_session_iframe),data.revocation_endpoint&&(this.revocation_endpoint=data.revocation_endpoint),data.introspection_endpoint&&(this.introspection_endpoint=data.introspection_endpoint),this.onWellKnownEndpointsLoaded.emit()):(this.oidcSecurityCommon.logDebug("AuthWellKnownEndpoints first time, get from the server"),this.getWellKnownEndpoints().subscribe(function(data){_this.issuer=data.issuer,_this.jwks_uri=data.jwks_uri,_this.authorization_endpoint=data.authorization_endpoint,_this.token_endpoint=data.token_endpoint,_this.userinfo_endpoint=data.userinfo_endpoint,data.end_session_endpoint&&(_this.end_session_endpoint=data.end_session_endpoint),data.check_session_iframe&&(_this.check_session_iframe=data.check_session_iframe),data.revocation_endpoint&&(_this.revocation_endpoint=data.revocation_endpoint),data.introspection_endpoint&&(_this.introspection_endpoint=data.introspection_endpoint),_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_well_known_endpoints,data),_this.oidcSecurityCommon.logDebug(data),_this.onWellKnownEndpointsLoaded.emit()}))},AuthWellKnownEndpoints}();AuthWellKnownEndpoints.decorators=[{type:_angular_core.Injectable}],AuthWellKnownEndpoints.ctorParameters=function(){return[{type:_angular_http.Http},{type:AuthConfiguration},{type:OidcSecurityCommon}]},AuthWellKnownEndpoints.propDecorators={onWellKnownEndpointsLoaded:[{type:_angular_core.Output}]};var OidcSecurityCheckSession=function(){function OidcSecurityCheckSession(authConfiguration,oidcSecurityCommon,authWellKnownEndpoints){this.authConfiguration=authConfiguration,this.oidcSecurityCommon=oidcSecurityCommon,this.authWellKnownEndpoints=authWellKnownEndpoints,this.onCheckSessionChanged=new _angular_core.EventEmitter(!0)}return OidcSecurityCheckSession.prototype.init=function(){var _this=this;return window.parent.document.getElementById("myiFrameForCheckSession")?rxjs_Observable.Observable.empty():(this.sessionIframe=window.document.createElement("iframe"),this.sessionIframe.id="myiFrameForCheckSession",this.oidcSecurityCommon.logDebug(this.sessionIframe),this.sessionIframe.style.display="none",this.sessionIframe.src=this.authWellKnownEndpoints.check_session_iframe,window.document.body.appendChild(this.sessionIframe),this.iframeMessageEvent=this.messageHandler.bind(this),window.addEventListener("message",this.iframeMessageEvent,!1),rxjs_Observable.Observable.create(function(observer){_this.sessionIframe.onload=function(){observer.next(_this),observer.complete()}}))},OidcSecurityCheckSession.prototype.pollServerSession=function(clientId){var _this=this,source=rxjs_Observable.Observable.timer(3e3,3e3).timeInterval().pluck("interval").take(1e4);source.subscribe(function(){_this.oidcSecurityCommon.logDebug(_this.sessionIframe);var session_state=_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_session_state);session_state&&""!==session_state&&_this.sessionIframe.contentWindow.postMessage(clientId+" "+session_state,_this.authConfiguration.stsServer)},function(err){_this.oidcSecurityCommon.logError("pollServerSession error: "+err)},function(){_this.oidcSecurityCommon.logDebug("checksession pollServerSession completed")})},OidcSecurityCheckSession.prototype.messageHandler=function(e){e.origin===this.authConfiguration.stsServer&&e.source===this.sessionIframe.contentWindow&&("error"===e.data?this.oidcSecurityCommon.logWarning("error from checksession messageHandler"):"changed"===e.data?this.onCheckSessionChanged.emit():this.oidcSecurityCommon.logDebug(e.data+" from checksession messageHandler"))},OidcSecurityCheckSession}();OidcSecurityCheckSession.decorators=[{type:_angular_core.Injectable}],OidcSecurityCheckSession.ctorParameters=function(){return[{type:AuthConfiguration},{type:OidcSecurityCommon},{type:AuthWellKnownEndpoints}]},OidcSecurityCheckSession.propDecorators={onCheckSessionChanged:[{type:_angular_core.Output}]};var OidcSecuritySilentRenew=function(){function OidcSecuritySilentRenew(oidcSecurityCommon){this.oidcSecurityCommon=oidcSecurityCommon}return OidcSecuritySilentRenew.prototype.initRenew=function(){var existsparent=void 0;try{var parentdoc=window.parent.document;if(!parentdoc)throw new Error("Unaccessible");existsparent=parentdoc.getElementById("myiFrameForSilentRenew")}catch(e){}var exists=window.document.getElementById("myiFrameForSilentRenew");existsparent?this.sessionIframe=existsparent:exists&&(this.sessionIframe=exists),exists||existsparent||(this.sessionIframe=window.document.createElement("iframe"),this.sessionIframe.id="myiFrameForSilentRenew",this.oidcSecurityCommon.logDebug(this.sessionIframe),this.sessionIframe.style.display="none",window.document.body.appendChild(this.sessionIframe))},OidcSecuritySilentRenew.prototype.startRenew=function(url){var _this=this,existsparent=void 0;try{var parentdoc=window.parent.document;if(!parentdoc)throw new Error("Unaccessible");existsparent=parentdoc.getElementById("myiFrameForSilentRenew")}catch(e){}var exists=window.document.getElementById("myiFrameForSilentRenew");return existsparent?this.sessionIframe=existsparent:exists&&(this.sessionIframe=exists),this.oidcSecurityCommon.logDebug("startRenew for URL:"+url),this.sessionIframe.src=url,rxjs_Observable.Observable.create(function(observer){_this.sessionIframe.onload=function(){observer.next(_this),observer.complete()}})},OidcSecuritySilentRenew}();OidcSecuritySilentRenew.decorators=[{type:_angular_core.Injectable}],OidcSecuritySilentRenew.ctorParameters=function(){return[{type:OidcSecurityCommon}]};var OidcSecurityUserService=function(){function OidcSecurityUserService(http,authConfiguration,oidcSecurityCommon,authWellKnownEndpoints){var _this=this;this.http=http,this.authConfiguration=authConfiguration,this.oidcSecurityCommon=oidcSecurityCommon,this.authWellKnownEndpoints=authWellKnownEndpoints,this.userData="",this.getIdentityUserData=function(){var headers=new _angular_http.Headers;headers.append("Accept","application/json");var token=_this.oidcSecurityCommon.getAccessToken();return""!==token&&headers.append("Authorization","Bearer "+decodeURIComponent(token)),_this.http.get(_this.authWellKnownEndpoints.userinfo_endpoint,{headers:headers,body:""}).map(function(res){return res.json()})}}return OidcSecurityUserService.prototype.initUserData=function(){var _this=this;return this.getIdentityUserData().map(function(data){return _this.userData=data})},OidcSecurityUserService.prototype.handleError=function(error){this.oidcSecurityCommon.logError(error)},OidcSecurityUserService}();OidcSecurityUserService.decorators=[{type:_angular_core.Injectable}],OidcSecurityUserService.ctorParameters=function(){return[{type:_angular_http.Http},{type:AuthConfiguration},{type:OidcSecurityCommon},{type:AuthWellKnownEndpoints}]};var AuthorizationResult={};AuthorizationResult.authorized=1,AuthorizationResult.forbidden=2,AuthorizationResult.unauthorized=3,AuthorizationResult[AuthorizationResult.authorized]="authorized",AuthorizationResult[AuthorizationResult.forbidden]="forbidden",AuthorizationResult[AuthorizationResult.unauthorized]="unauthorized";var OidcSecurityService=function(){function OidcSecurityService(platformId,http,authConfiguration,router,oidcSecurityCheckSession,oidcSecuritySilentRenew,oidcSecurityUserService,oidcSecurityCommon,authWellKnownEndpoints){this.platformId=platformId,this.http=http,this.authConfiguration=authConfiguration,this.router=router,this.oidcSecurityCheckSession=oidcSecurityCheckSession,this.oidcSecuritySilentRenew=oidcSecuritySilentRenew,this.oidcSecurityUserService=oidcSecurityUserService,this.oidcSecurityCommon=oidcSecurityCommon,this.authWellKnownEndpoints=authWellKnownEndpoints,this.onModuleSetup=new _angular_core.EventEmitter(!0),this.onAuthorizationResult=new _angular_core.EventEmitter(!0),this.moduleSetup=!1,this._isAuthorized=new rxjs_BehaviorSubject.BehaviorSubject(!1),this._userData=new rxjs_BehaviorSubject.BehaviorSubject(""),this.authWellKnownEndpointsLoaded=!1}return OidcSecurityService.prototype.setupModule=function(openIDImplicitFlowConfiguration){var _this=this;this.authConfiguration.init(openIDImplicitFlowConfiguration),this.oidcSecurityValidation=new OidcSecurityValidation(this.oidcSecurityCommon),this.oidcSecurityCheckSession.onCheckSessionChanged.subscribe(function(){_this.onCheckSessionChanged()}),this.authWellKnownEndpoints.onWellKnownEndpointsLoaded.subscribe(function(){_this.onWellKnownEndpointsLoaded()}),this.oidcSecurityCommon.setupModule(),""!==this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_user_data)&&this.setUserData(this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_user_data)),""!==this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_is_authorized)&&(this.setIsAuthorized(this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_is_authorized)),this.runTokenValidatation()),this.oidcSecurityCommon.logDebug("STS server: "+this.authConfiguration.stsServer),_angular_common.isPlatformBrowser(this.platformId)?(this.authWellKnownEndpoints.onWellKnownEndpointsLoaded.subscribe(function(){_this.moduleSetup=!0,_this.onModuleSetup.emit()}),this.authWellKnownEndpoints.setupModule(),this.authConfiguration.silent_renew&&this.oidcSecuritySilentRenew.initRenew(),this.authConfiguration.start_checksession&&this.oidcSecurityCheckSession.init().subscribe(function(){_this.oidcSecurityCheckSession.pollServerSession(_this.authConfiguration.client_id)})):(this.moduleSetup=!0,this.onModuleSetup.emit())},OidcSecurityService.prototype.getUserData=function(){return this._userData.asObservable()},OidcSecurityService.prototype.setUserData=function(userData){this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_user_data,userData),this._userData.next(userData)},OidcSecurityService.prototype.getIsAuthorized=function(){return this._isAuthorized.asObservable()},OidcSecurityService.prototype.setIsAuthorized=function(isAuthorized){this._isAuthorizedValue=isAuthorized,this._isAuthorized.next(isAuthorized)},OidcSecurityService.prototype.getToken=function(){if(!this._isAuthorizedValue)return"";var token=this.oidcSecurityCommon.getAccessToken();return decodeURIComponent(token)},OidcSecurityService.prototype.getIdToken=function(){if(!this._isAuthorizedValue)return"";var token=this.oidcSecurityCommon.getIdToken();return decodeURIComponent(token)},OidcSecurityService.prototype.getPayloadFromIdToken=function(encode){void 0===encode&&(encode=!1);var token=this.getIdToken();return this.oidcSecurityValidation.getPayloadFromToken(token,encode)},OidcSecurityService.prototype.setState=function(state){this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_state_control,state)},OidcSecurityService.prototype.getState=function(){return this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control)},OidcSecurityService.prototype.setCustomRequestParameters=function(params){this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_custom_request_params,params)},OidcSecurityService.prototype.authorize=function(){var data=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_well_known_endpoints);if(data&&""!==data&&(this.authWellKnownEndpointsLoaded=!0),!this.authWellKnownEndpointsLoaded)return void this.oidcSecurityCommon.logError("Well known endpoints must be loaded before user can login!")
;if(this.oidcSecurityValidation.config_validate_response_type(this.authConfiguration.response_type)){this.resetAuthorizationData(!1),this.oidcSecurityCommon.logDebug("BEGIN Authorize, no auth data");var state=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control);""!==state&&null!==state||(state=Date.now()+""+Math.random(),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_state_control,state));var nonce="N"+Math.random()+Date.now();this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_nonce,nonce),this.oidcSecurityCommon.logDebug("AuthorizedController created. local state: "+this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control));var url=this.createAuthorizeUrl(nonce,state,this.authWellKnownEndpoints.authorization_endpoint);window.location.href=url}},OidcSecurityService.prototype.authorizedCallback=function(hash){var _this=this,silentRenew=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_silent_renew_running),isRenewProcess="running"===silentRenew;this.oidcSecurityCommon.logDebug("BEGIN authorizedCallback, no auth data"),this.resetAuthorizationData(isRenewProcess),hash=hash||window.location.hash.substr(1);var result=hash.split("&").reduce(function(result,item){var parts=item.split("=");return result[parts[0]]=parts[1],result},{});this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_result,result),this.oidcSecurityCommon.logDebug(result),this.oidcSecurityCommon.logDebug("authorizedCallback created, begin token validation");var decoded_id_token,access_token="",id_token="",authResponseIsValid=!1;this.getSigningKeys().subscribe(function(jwtKeys){if(_this.jwtKeys=jwtKeys,!result.error)if(_this.oidcSecurityValidation.validateStateFromHashCallback(result.state,_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_auth_state_control))){"id_token token"===_this.authConfiguration.response_type&&(access_token=result.access_token),id_token=result.id_token;decoded_id_token=_this.oidcSecurityValidation.getPayloadFromToken(id_token,!1),_this.oidcSecurityValidation.getHeaderFromToken(id_token,!1),_this.oidcSecurityValidation.validate_signature_id_token(id_token,_this.jwtKeys)?_this.oidcSecurityValidation.validate_id_token_nonce(decoded_id_token,_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_auth_nonce))?_this.oidcSecurityValidation.validate_required_id_token(decoded_id_token)?_this.oidcSecurityValidation.validate_id_token_iat_max_offset(decoded_id_token,_this.authConfiguration.max_id_token_iat_offset_allowed_in_seconds)?_this.oidcSecurityValidation.validate_id_token_iss(decoded_id_token,_this.authWellKnownEndpoints.issuer)?_this.oidcSecurityValidation.validate_id_token_aud(decoded_id_token,_this.authConfiguration.client_id)?_this.oidcSecurityValidation.validate_id_token_exp_not_expired(decoded_id_token)?"id_token token"===_this.authConfiguration.response_type?_this.oidcSecurityValidation.validate_id_token_at_hash(access_token,decoded_id_token.at_hash)||!access_token?(authResponseIsValid=!0,_this.successful_validation()):_this.oidcSecurityCommon.logWarning("authorizedCallback incorrect at_hash"):(authResponseIsValid=!0,_this.successful_validation()):_this.oidcSecurityCommon.logWarning("authorizedCallback token expired"):_this.oidcSecurityCommon.logWarning("authorizedCallback incorrect aud"):_this.oidcSecurityCommon.logWarning("authorizedCallback incorrect iss does not match authWellKnownEndpoints issuer"):_this.oidcSecurityCommon.logWarning("authorizedCallback Validation, iat rejected id_token was issued too far away from the current time"):_this.oidcSecurityCommon.logDebug("authorizedCallback Validation, one of the REQUIRED properties missing from id_token"):_this.oidcSecurityCommon.logWarning("authorizedCallback incorrect nonce"):_this.oidcSecurityCommon.logDebug("authorizedCallback Signature validation failed id_token")}else _this.oidcSecurityCommon.logWarning("authorizedCallback incorrect state");_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_silent_renew_running,""),authResponseIsValid?(_this.setAuthorizationData(access_token,id_token),_this.authConfiguration.auto_userinfo?_this.getUserinfo(isRenewProcess,result,id_token,decoded_id_token).subscribe(function(response){response?_this.authConfiguration.trigger_authorization_result_event?_this.onAuthorizationResult.emit(AuthorizationResult.authorized):_this.router.navigate([_this.authConfiguration.startup_route]):_this.authConfiguration.trigger_authorization_result_event?_this.onAuthorizationResult.emit(AuthorizationResult.unauthorized):_this.router.navigate([_this.authConfiguration.unauthorized_route])}):(_this.runTokenValidatation(),_this.authConfiguration.trigger_authorization_result_event?_this.onAuthorizationResult.emit(AuthorizationResult.authorized):_this.router.navigate([_this.authConfiguration.startup_route]))):(_this.oidcSecurityCommon.logDebug("authorizedCallback, token(s) validation failed, resetting"),_this.resetAuthorizationData(!1),_this.authConfiguration.trigger_authorization_result_event?_this.onAuthorizationResult.emit(AuthorizationResult.unauthorized):_this.router.navigate([_this.authConfiguration.unauthorized_route]))})},OidcSecurityService.prototype.getUserinfo=function(isRenewProcess,result,id_token,decoded_id_token){var _this=this;return void 0===isRenewProcess&&(isRenewProcess=!1),result=result||this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_result),id_token=id_token||this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_id_token),decoded_id_token=decoded_id_token||this.oidcSecurityValidation.getPayloadFromToken(id_token,!1),new rxjs_Observable.Observable(function(observer){"id_token token"===_this.authConfiguration.response_type?isRenewProcess?(_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_session_state,result.session_state),observer.next(!0),observer.complete()):_this.oidcSecurityUserService.initUserData().subscribe(function(){_this.oidcSecurityCommon.logDebug("authorizedCallback id_token token flow"),_this.oidcSecurityValidation.validate_userdata_sub_id_token(decoded_id_token.sub,_this.oidcSecurityUserService.userData.sub)?(_this.setUserData(_this.oidcSecurityUserService.userData),_this.oidcSecurityCommon.logDebug(_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_access_token)),_this.oidcSecurityCommon.logDebug(_this.oidcSecurityUserService.userData),_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_session_state,result.session_state),_this.runTokenValidatation(),observer.next(!0)):(_this.oidcSecurityCommon.logWarning("authorizedCallback, User data sub does not match sub in id_token"),_this.oidcSecurityCommon.logDebug("authorizedCallback, token(s) validation failed, resetting"),_this.resetAuthorizationData(!1),observer.next(!1)),observer.complete()}):(_this.oidcSecurityCommon.logDebug("authorizedCallback id_token flow"),_this.oidcSecurityCommon.logDebug(_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_access_token)),_this.oidcSecurityUserService.userData=decoded_id_token,_this.setUserData(_this.oidcSecurityUserService.userData),_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_session_state,result.session_state),isRenewProcess||_this.runTokenValidatation(),observer.next(!0),observer.complete())})},OidcSecurityService.prototype.logoff=function(){if(this.oidcSecurityCommon.logDebug("BEGIN Authorize, no auth data"),this.authWellKnownEndpoints.end_session_endpoint){var end_session_endpoint=this.authWellKnownEndpoints.end_session_endpoint,id_token_hint=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_id_token),url=this.createEndSessionUrl(end_session_endpoint,id_token_hint);this.resetAuthorizationData(!1),this.authConfiguration.start_checksession&&this.checkSessionChanged?this.oidcSecurityCommon.logDebug("only local login cleaned up, server session has changed"):window.location.href=url}else this.resetAuthorizationData(!1),this.oidcSecurityCommon.logDebug("only local login cleaned up, no end_session_endpoint")},OidcSecurityService.prototype.successful_validation=function(){this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_nonce,""),this.authConfiguration.auto_clean_state_after_authentication&&this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_state_control,""),this.oidcSecurityCommon.logDebug("AuthorizedCallback token(s) validated, continue")},OidcSecurityService.prototype.refreshSession=function(){this.oidcSecurityCommon.logDebug("BEGIN refresh session Authorize");var state=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control);""!==state&&null!==state||(state=Date.now()+""+Math.random(),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_state_control,state));var nonce="N"+Math.random()+Date.now();this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_nonce,nonce),this.oidcSecurityCommon.logDebug("RefreshSession created. adding myautostate: "+this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control));var url=this.createAuthorizeUrl(nonce,state,this.authWellKnownEndpoints.authorization_endpoint);this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_silent_renew_running,"running"),this.oidcSecuritySilentRenew.startRenew(url)},OidcSecurityService.prototype.setAuthorizationData=function(access_token,id_token){""!==this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_access_token)&&this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_access_token,""),this.oidcSecurityCommon.logDebug(access_token),this.oidcSecurityCommon.logDebug(id_token),this.oidcSecurityCommon.logDebug("storing to storage, getting the roles"),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_access_token,access_token),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_id_token,id_token),this.setIsAuthorized(!0),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_is_authorized,!0)},OidcSecurityService.prototype.createAuthorizeUrl=function(nonce,state,authorization_endpoint){var urlParts=authorization_endpoint.split("?"),authorizationUrl=urlParts[0],params=new _angular_http.URLSearchParams(urlParts[1]);params.set("client_id",this.authConfiguration.client_id),params.set("redirect_uri",this.authConfiguration.redirect_url),params.set("response_type",this.authConfiguration.response_type),params.set("scope",this.authConfiguration.scope),params.set("nonce",nonce),params.set("state",state),this.authConfiguration.hd_param&&params.set("hd",this.authConfiguration.hd_param);var customParams=Object.assign({},this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_custom_request_params));return Object.keys(customParams).forEach(function(key){params.set(key,customParams[key])}),authorizationUrl+"?"+params},OidcSecurityService.prototype.createEndSessionUrl=function(end_session_endpoint,id_token_hint){var urlParts=end_session_endpoint.split("?"),authorizationEndsessionUrl=urlParts[0],params=new _angular_http.URLSearchParams(urlParts[1]);return params.set("id_token_hint",id_token_hint),params.set("post_logout_redirect_uri",this.authConfiguration.post_logout_redirect_uri),authorizationEndsessionUrl+"?"+params},OidcSecurityService.prototype.resetAuthorizationData=function(isRenewProcess){isRenewProcess||(this.setIsAuthorized(!1),this.oidcSecurityCommon.resetStorageData(isRenewProcess),this.checkSessionChanged=!1)},OidcSecurityService.prototype.handleError=function(error){if(this.oidcSecurityCommon.logError(error),403==error.status)this.authConfiguration.trigger_authorization_result_event?this.onAuthorizationResult.emit(AuthorizationResult.unauthorized):this.router.navigate([this.authConfiguration.forbidden_route]);else if(401==error.status){var silentRenew=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_silent_renew_running);this.resetAuthorizationData(silentRenew),this.authConfiguration.trigger_authorization_result_event?this.onAuthorizationResult.emit(AuthorizationResult.unauthorized):this.router.navigate([this.authConfiguration.unauthorized_route])}},OidcSecurityService.prototype.onCheckSessionChanged=function(){this.oidcSecurityCommon.logDebug("onCheckSessionChanged"),this.checkSessionChanged=!0},OidcSecurityService.prototype.onWellKnownEndpointsLoaded=function(){this.oidcSecurityCommon.logDebug("onWellKnownEndpointsLoaded"),this.authWellKnownEndpointsLoaded=!0},OidcSecurityService.prototype.runGetSigningKeys=function(){var _this=this;this.getSigningKeys().subscribe(function(jwtKeys){return _this.jwtKeys=jwtKeys},function(error){return _this.errorMessage=error})},OidcSecurityService.prototype.getSigningKeys=function(){return this.oidcSecurityCommon.logDebug("jwks_uri: "+this.authWellKnownEndpoints.jwks_uri),this.http.get(this.authWellKnownEndpoints.jwks_uri).map(this.extractData).catch(this.handleErrorGetSigningKeys)},OidcSecurityService.prototype.extractData=function(res){return res.json()},OidcSecurityService.prototype.handleErrorGetSigningKeys=function(error){var errMsg;if(error instanceof _angular_http.Response){var body=error.json()||{},err=body.error||JSON.stringify(body);errMsg=error.status+" - "+(error.statusText||"")+" "+err}else errMsg=error.message?error.message:error.toString();return console.error(errMsg),rxjs_Observable.Observable.throw(errMsg)},OidcSecurityService.prototype.runTokenValidatation=function(){var _this=this;if(!this.runTokenValidatationRunning){this.runTokenValidatationRunning=!0;var source=rxjs_Observable.Observable.timer(5e3,3e3).timeInterval().pluck("interval").take(1e4);source.subscribe(function(){_this._isAuthorizedValue&&_this.oidcSecurityValidation.isTokenExpired(_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_id_token),_this.authConfiguration.silent_renew_offset_in_seconds)&&(_this.oidcSecurityCommon.logDebug("IsAuthorized: id_token isTokenExpired, start silent renew if active"),_this.authConfiguration.silent_renew?_this.refreshSession():_this.resetAuthorizationData(!1))},function(err){_this.oidcSecurityCommon.logError("Error: "+err)},function(){_this.oidcSecurityCommon.logDebug("Completed")})}},OidcSecurityService}();OidcSecurityService.decorators=[{type:_angular_core.Injectable}],OidcSecurityService.ctorParameters=function(){return[{type:Object,decorators:[{type:_angular_core.Inject,args:[_angular_core.PLATFORM_ID]}]},{type:_angular_http.Http},{type:AuthConfiguration},{type:_angular_router.Router},{type:OidcSecurityCheckSession},{type:OidcSecuritySilentRenew},{type:OidcSecurityUserService},{type:OidcSecurityCommon},{type:AuthWellKnownEndpoints}]},OidcSecurityService.propDecorators={onModuleSetup:[{type:_angular_core.Output}],onAuthorizationResult:[{type:_angular_core.Output}]};var AuthModule=function(){function AuthModule(){}return AuthModule.forRoot=function(token){return void 0===token&&(token={}),{ngModule:AuthModule,providers:[OidcSecurityService,OidcSecurityValidation,OidcSecurityCheckSession,OidcSecuritySilentRenew,OidcSecurityUserService,OidcSecurityCommon,AuthConfiguration,DefaultConfiguration,AuthWellKnownEndpoints,{provide:OidcSecurityStorage,useClass:token.storage||BrowserStorage}]}},AuthModule.forChild=function(token){return void 0===token&&(token={}),{ngModule:AuthModule,providers:[OidcSecurityService,OidcSecurityValidation,OidcSecurityCheckSession,OidcSecuritySilentRenew,OidcSecurityUserService,OidcSecurityCommon,AuthConfiguration,AuthWellKnownEndpoints,{provide:OidcSecurityStorage,useClass:token.storage||BrowserStorage}]}},AuthModule}();AuthModule.decorators=[{type:_angular_core.NgModule}],AuthModule.ctorParameters=function(){return[]},exports.OidcSecurityService=OidcSecurityService,exports.OidcSecurityValidation=OidcSecurityValidation,exports.OidcSecurityCheckSession=OidcSecurityCheckSession,exports.OidcSecuritySilentRenew=OidcSecuritySilentRenew,exports.OidcSecurityUserService=OidcSecurityUserService,exports.OidcSecurityCommon=OidcSecurityCommon,exports.OidcSecurityStorage=OidcSecurityStorage,exports.BrowserStorage=BrowserStorage,exports.AuthWellKnownEndpoints=AuthWellKnownEndpoints,exports.AuthConfiguration=AuthConfiguration,exports.OpenIDImplicitFlowConfiguration=OpenIDImplicitFlowConfiguration,exports.DefaultConfiguration=DefaultConfiguration,exports.AuthModule=AuthModule,exports.AuthorizationResult=AuthorizationResult,Object.defineProperty(exports,"__esModule",{value:!0})});
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/common"),require("@angular/http"),require("rxjs/add/operator/map"),require("rxjs/add/operator/catch"),require("rxjs/add/operator/timeInterval"),require("rxjs/add/operator/pluck"),require("rxjs/add/operator/take"),require("rxjs/add/observable/interval"),require("rxjs/add/observable/timer"),require("rxjs/Observable"),require("rxjs/BehaviorSubject"),require("@angular/router"),require("jsrsasign"),require("rxjs/add/observable/throw"),require("rxjs/add/observable/empty")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/http","rxjs/add/operator/map","rxjs/add/operator/catch","rxjs/add/operator/timeInterval","rxjs/add/operator/pluck","rxjs/add/operator/take","rxjs/add/observable/interval","rxjs/add/observable/timer","rxjs/Observable","rxjs/BehaviorSubject","@angular/router","jsrsasign","rxjs/add/observable/throw","rxjs/add/observable/empty"],factory):factory((global.ng=global.ng||{},global.ng.angularAuthOidcClient=global.ng.angularAuthOidcClient||{}),global.ng.core,global.ng.common,global.ng.http,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable,global.Rx.Observable,global.Rx,global.Rx,global.ng.router,global.jsrsasign)}(this,function(exports,_angular_core,_angular_common,_angular_http,rxjs_add_operator_map,rxjs_add_operator_catch,rxjs_add_operator_timeInterval,rxjs_add_operator_pluck,rxjs_add_operator_take,rxjs_add_observable_interval,rxjs_add_observable_timer,rxjs_Observable,rxjs_BehaviorSubject,_angular_router,jsrsasign){"use strict";var DefaultConfiguration=function(){function DefaultConfiguration(){this.stsServer="https://localhost:44318",this.redirect_url="https://localhost:44311",this.client_id="angularclient",this.response_type="id_token token",this.resource="",this.scope="openid email profile",this.hd_param="",this.post_logout_redirect_uri="https://localhost:44311/unauthorized",this.start_checksession=!1,this.silent_renew=!0,this.silent_renew_offset_in_seconds=0,this.post_login_route="/",this.forbidden_route="/forbidden",this.unauthorized_route="/unauthorized",this.auto_userinfo=!0,this.log_console_warning_active=!0,this.log_console_debug_active=!1,this.max_id_token_iat_offset_allowed_in_seconds=3,this.override_well_known_configuration=!1,this.override_well_known_configuration_url="https://localhost:44386/wellknownconfiguration.json",this.storage="undefined"!=typeof Storage?sessionStorage:null}return DefaultConfiguration}(),OpenIDImplicitFlowConfiguration=function(){function OpenIDImplicitFlowConfiguration(){}return OpenIDImplicitFlowConfiguration}(),AuthConfiguration=function(){function AuthConfiguration(defaultConfig){this.defaultConfig=defaultConfig}return Object.defineProperty(AuthConfiguration.prototype,"stsServer",{get:function(){return this.openIDImplicitFlowConfiguration.stsServer||this.defaultConfig.stsServer},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"redirect_url",{get:function(){return this.openIDImplicitFlowConfiguration.redirect_url||this.defaultConfig.redirect_url},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"client_id",{get:function(){return this.openIDImplicitFlowConfiguration.client_id||this.defaultConfig.client_id},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"response_type",{get:function(){return this.openIDImplicitFlowConfiguration.response_type||this.defaultConfig.response_type},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"resource",{get:function(){return this.openIDImplicitFlowConfiguration.resource||this.defaultConfig.resource},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"scope",{get:function(){return this.openIDImplicitFlowConfiguration.scope||this.defaultConfig.scope},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"hd_param",{get:function(){return this.openIDImplicitFlowConfiguration.hd_param||this.defaultConfig.hd_param},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"post_logout_redirect_uri",{get:function(){return this.openIDImplicitFlowConfiguration.post_logout_redirect_uri||this.defaultConfig.post_logout_redirect_uri},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"start_checksession",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.start_checksession?this.openIDImplicitFlowConfiguration.start_checksession:this.defaultConfig.start_checksession},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"silent_renew",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.silent_renew?this.openIDImplicitFlowConfiguration.silent_renew:this.defaultConfig.silent_renew},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"silent_renew_offset_in_seconds",{get:function(){return this.openIDImplicitFlowConfiguration.silent_renew_offset_in_seconds||this.defaultConfig.silent_renew_offset_in_seconds},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"post_login_route",{get:function(){return this.openIDImplicitFlowConfiguration.post_login_route||this.defaultConfig.post_login_route},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"forbidden_route",{get:function(){return this.openIDImplicitFlowConfiguration.forbidden_route||this.defaultConfig.forbidden_route},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"unauthorized_route",{get:function(){return this.openIDImplicitFlowConfiguration.unauthorized_route||this.defaultConfig.unauthorized_route},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"auto_userinfo",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.auto_userinfo?this.openIDImplicitFlowConfiguration.auto_userinfo:this.defaultConfig.auto_userinfo},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"auto_clean_state_after_authentication",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.auto_clean_state_after_authentication?this.openIDImplicitFlowConfiguration.auto_clean_state_after_authentication:this.defaultConfig.auto_clean_state_after_authentication},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"trigger_authorization_result_event",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.trigger_authorization_result_event?this.openIDImplicitFlowConfiguration.trigger_authorization_result_event:this.defaultConfig.trigger_authorization_result_event},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"log_console_warning_active",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.log_console_warning_active?this.openIDImplicitFlowConfiguration.log_console_warning_active:this.defaultConfig.log_console_warning_active},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"log_console_debug_active",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.log_console_debug_active?this.openIDImplicitFlowConfiguration.log_console_debug_active:this.defaultConfig.log_console_debug_active},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"max_id_token_iat_offset_allowed_in_seconds",{get:function(){return this.openIDImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds||this.defaultConfig.max_id_token_iat_offset_allowed_in_seconds},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"override_well_known_configuration",{get:function(){return void 0!==this.openIDImplicitFlowConfiguration.override_well_known_configuration?this.openIDImplicitFlowConfiguration.override_well_known_configuration:this.defaultConfig.override_well_known_configuration},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"override_well_known_configuration_url",{get:function(){return this.openIDImplicitFlowConfiguration.override_well_known_configuration_url||this.defaultConfig.override_well_known_configuration_url},enumerable:!0,configurable:!0}),Object.defineProperty(AuthConfiguration.prototype,"storage",{get:function(){return this.openIDImplicitFlowConfiguration.storage||this.defaultConfig.storage},enumerable:!0,configurable:!0}),AuthConfiguration.prototype.init=function(openIDImplicitFlowConfiguration){this.openIDImplicitFlowConfiguration=openIDImplicitFlowConfiguration},AuthConfiguration}();AuthConfiguration.decorators=[{type:_angular_core.Injectable}],AuthConfiguration.ctorParameters=function(){return[{type:DefaultConfiguration}]};var OidcSecurityStorage=function(){function OidcSecurityStorage(){}return OidcSecurityStorage.prototype.read=function(key){},OidcSecurityStorage.prototype.write=function(key,value){},OidcSecurityStorage}();OidcSecurityStorage.decorators=[{type:_angular_core.Injectable}],OidcSecurityStorage.ctorParameters=function(){return[]};var BrowserStorage=function(){function BrowserStorage(authConfiguration){this.authConfiguration=authConfiguration,this.hasStorage="undefined"!=typeof Storage}return BrowserStorage.prototype.read=function(key){if(this.hasStorage)return JSON.parse(this.authConfiguration.storage.getItem(key))},BrowserStorage.prototype.write=function(key,value){this.hasStorage&&(value=void 0===value?null:value,this.authConfiguration.storage.setItem(key,JSON.stringify(value)))},BrowserStorage}();BrowserStorage.decorators=[{type:_angular_core.Injectable}],BrowserStorage.ctorParameters=function(){return[{type:AuthConfiguration}]};var OidcSecurityCommon=function(){function OidcSecurityCommon(authConfiguration,oidcSecurityStorage){this.authConfiguration=authConfiguration,this.oidcSecurityStorage=oidcSecurityStorage,this.storage_auth_result="authorizationResult",this.storage_access_token="authorizationData",this.storage_id_token="authorizationDataIdToken",this.storage_is_authorized="_isAuthorized",this.storage_user_data="userData",this.storage_auth_nonce="authNonce",this.storage_auth_state_control="authStateControl",this.storage_well_known_endpoints="wellknownendpoints",this.storage_session_state="session_state",this.storage_silent_renew_running="storage_silent_renew_running",this.storage_custom_request_params="storage_custom_request_params"}return OidcSecurityCommon.prototype.setupModule=function(){},OidcSecurityCommon.prototype.retrieve=function(key){return this.oidcSecurityStorage.read(key)},OidcSecurityCommon.prototype.store=function(key,value){this.oidcSecurityStorage.write(key,value)},OidcSecurityCommon.prototype.resetStorageData=function(isRenewProcess){isRenewProcess||(this.store(this.storage_auth_result,""),this.store(this.storage_session_state,""),this.store(this.storage_silent_renew_running,""),this.store(this.storage_is_authorized,!1),this.store(this.storage_access_token,""),this.store(this.storage_id_token,""),this.store(this.storage_user_data,""))},OidcSecurityCommon.prototype.getAccessToken=function(){return this.retrieve(this.storage_access_token)},OidcSecurityCommon.prototype.getIdToken=function(){return this.retrieve(this.storage_id_token)},OidcSecurityCommon.prototype.logError=function(message){console.error(message)},OidcSecurityCommon.prototype.logWarning=function(message){this.authConfiguration.log_console_warning_active&&console.warn(message)},OidcSecurityCommon.prototype.logDebug=function(message){this.authConfiguration.log_console_debug_active&&console.log(message)},OidcSecurityCommon}();OidcSecurityCommon.decorators=[{type:_angular_core.Injectable}],OidcSecurityCommon.ctorParameters=function(){return[{type:AuthConfiguration},{type:OidcSecurityStorage}]};var OidcSecurityValidation=function(){function OidcSecurityValidation(oidcSecurityCommon){this.oidcSecurityCommon=oidcSecurityCommon}return OidcSecurityValidation.prototype.isTokenExpired=function(token,offsetSeconds){var decoded;return decoded=this.getPayloadFromToken(token,!1),!this.validate_id_token_exp_not_expired(decoded,offsetSeconds)},OidcSecurityValidation.prototype.validate_id_token_exp_not_expired=function(decoded_id_token,offsetSeconds){var tokenExpirationDate=this.getTokenExpirationDate(decoded_id_token);return offsetSeconds=offsetSeconds||0,null!=tokenExpirationDate&&tokenExpirationDate.valueOf()>(new Date).valueOf()+1e3*offsetSeconds},OidcSecurityValidation.prototype.validate_required_id_token=function(dataIdToken){var validated=!0;return dataIdToken.hasOwnProperty("iss")||(validated=!1,this.oidcSecurityCommon.logWarning("iss is missing, this is required in the id_token")),dataIdToken.hasOwnProperty("sub")||(validated=!1,this.oidcSecurityCommon.logWarning("sub is missing, this is required in the id_token")),dataIdToken.hasOwnProperty("aud")||(validated=!1,this.oidcSecurityCommon.logWarning("aud is missing, this is required in the id_token")),dataIdToken.hasOwnProperty("exp")||(validated=!1,this.oidcSecurityCommon.logWarning("exp is missing, this is required in the id_token")),dataIdToken.hasOwnProperty("iat")||(validated=!1,this.oidcSecurityCommon.logWarning("iat is missing, this is required in the id_token")),validated},OidcSecurityValidation.prototype.validate_id_token_iat_max_offset=function(dataIdToken,max_offset_allowed_in_seconds){if(!dataIdToken.hasOwnProperty("iat"))return!1;var dateTime_iat_id_token=new Date(0);return dateTime_iat_id_token.setUTCSeconds(dataIdToken.iat),max_offset_allowed_in_seconds=max_offset_allowed_in_seconds||0,null!=dateTime_iat_id_token&&(this.oidcSecurityCommon.logDebug("validate_id_token_iat_max_offset: "+((new Date).valueOf()-dateTime_iat_id_token.valueOf())+" < "+1e3*max_offset_allowed_in_seconds),(new Date).valueOf()-dateTime_iat_id_token.valueOf()<1e3*max_offset_allowed_in_seconds)},OidcSecurityValidation.prototype.validate_id_token_nonce=function(dataIdToken,local_nonce){return dataIdToken.nonce===local_nonce||(this.oidcSecurityCommon.logDebug("Validate_id_token_nonce failed, dataIdToken.nonce: "+dataIdToken.nonce+" local_nonce:"+local_nonce),!1)},OidcSecurityValidation.prototype.validate_id_token_iss=function(dataIdToken,authWellKnownEndpoints_issuer){return dataIdToken.iss==authWellKnownEndpoints_issuer||(this.oidcSecurityCommon.logDebug("Validate_id_token_iss failed, dataIdToken.iss: "+dataIdToken.iss+" authWellKnownEndpoints issuer:"+authWellKnownEndpoints_issuer),!1)},OidcSecurityValidation.prototype.validate_id_token_aud=function(dataIdToken,aud){return dataIdToken.aud==aud||(this.oidcSecurityCommon.logDebug("Validate_id_token_aud failed, dataIdToken.aud: "+dataIdToken.aud+" client_id:"+aud),!1)},OidcSecurityValidation.prototype.validateStateFromHashCallback=function(state,local_state){return state==local_state||(this.oidcSecurityCommon.logDebug("ValidateStateFromHashCallback failed, state: "+state+" local_state:"+local_state),!1)},OidcSecurityValidation.prototype.validate_userdata_sub_id_token=function(id_token_sub,userdata_sub){return id_token_sub==userdata_sub||(this.oidcSecurityCommon.logDebug("validate_userdata_sub_id_token failed, id_token_sub: "+id_token_sub+" userdata_sub:"+userdata_sub),!1)},OidcSecurityValidation.prototype.getPayloadFromToken=function(token,encode){var data={};if(void 0!==token){var encoded=token.split(".")[1];if(encode)return encoded;data=JSON.parse(this.urlBase64Decode(encoded))}return data},OidcSecurityValidation.prototype.getHeaderFromToken=function(token,encode){var data={};if(void 0!==token){var encoded=token.split(".")[0];if(encode)return encoded;data=JSON.parse(this.urlBase64Decode(encoded))}return data},OidcSecurityValidation.prototype.getSignatureFromToken=function(token,encode){var data={};if(void 0!==token){var encoded=token.split(".")[2];if(encode)return encoded;data=JSON.parse(this.urlBase64Decode(encoded))}return data},OidcSecurityValidation.prototype.validate_signature_id_token=function(id_token,jwtkeys){if(!jwtkeys||!jwtkeys.keys)return!1;var header_data=this.getHeaderFromToken(id_token,!1);if(0===Object.keys(header_data).length&&header_data.constructor===Object)return this.oidcSecurityCommon.logWarning("id token has no header data"),!1;var kid=header_data.kid;if("RS256"!=header_data.alg)return this.oidcSecurityCommon.logWarning("Only RS256 supported"),!1;var isValid=!1;if(header_data.hasOwnProperty("kid"))for(var _d=0,_e=jwtkeys.keys;_d<_e.length;_d++){var key=_e[_d];if(key.kid==kid){var publickey=jsrsasign.KEYUTIL.getKey(key);return isValid=jsrsasign.KJUR.jws.JWS.verify(id_token,publickey,["RS256"]),isValid||this.oidcSecurityCommon.logWarning("incorrect Signature, validation failed for id_token"),isValid}}else{for(var amountOfMatchingKeys=0,_i=0,_a=jwtkeys.keys;_i<_a.length;_i++){var key=_a[_i];"RSA"==key.kty&&"sig"==key.use&&(amountOfMatchingKeys+=1)}if(0==amountOfMatchingKeys)return this.oidcSecurityCommon.logWarning("no keys found, incorrect Signature, validation failed for id_token"),!1;if(amountOfMatchingKeys>1)return this.oidcSecurityCommon.logWarning("no ID Token kid claim in JOSE header and multiple supplied in jwks_uri"),!1;for(var _b=0,_c=jwtkeys.keys;_b<_c.length;_b++){var key=_c[_b];if("RSA"==key.kty&&"sig"==key.use){var publickey=jsrsasign.KEYUTIL.getKey(key);return isValid=jsrsasign.KJUR.jws.JWS.verify(id_token,publickey,["RS256"]),isValid||this.oidcSecurityCommon.logWarning("incorrect Signature, validation failed for id_token"),isValid}}}return isValid},OidcSecurityValidation.prototype.config_validate_response_type=function(response_type){return"id_token token"===response_type||"id_token"===response_type||(this.oidcSecurityCommon.logWarning("module configure incorrect, invalid response_type:"+response_type),!1)},OidcSecurityValidation.prototype.validate_id_token_at_hash=function(access_token,at_hash){this.oidcSecurityCommon.logDebug("From the server:"+at_hash);var testdata=this.generate_at_hash(""+access_token);if(this.oidcSecurityCommon.logDebug("client validation not decoded:"+testdata),testdata==at_hash)return!0;var testValue=this.generate_at_hash(""+decodeURIComponent(access_token));return this.oidcSecurityCommon.logDebug("-gen access--"+testValue),testValue==at_hash},OidcSecurityValidation.prototype.generate_at_hash=function(access_token){var hash=jsrsasign.KJUR.crypto.Util.hashString(access_token,"sha256"),first128bits=hash.substr(0,hash.length/2);return jsrsasign.hextob64u(first128bits)},OidcSecurityValidation.prototype.getTokenExpirationDate=function(dataIdToken){if(!dataIdToken.hasOwnProperty("exp"))return new Date;var date=new Date(0);return date.setUTCSeconds(dataIdToken.exp),date},OidcSecurityValidation.prototype.urlBase64Decode=function(str){var output=str.replace("-","+").replace("_","/");switch(output.length%4){case 0:break;case 2:output+="==";break;case 3:output+="=";break;default:throw"Illegal base64url string!"}return window.atob(output)},OidcSecurityValidation}();OidcSecurityValidation.decorators=[{type:_angular_core.Injectable}],OidcSecurityValidation.ctorParameters=function(){return[{type:OidcSecurityCommon}]};var AuthWellKnownEndpoints=function(){function AuthWellKnownEndpoints(http,authConfiguration,oidcSecurityCommon){var _this=this;this.http=http,this.authConfiguration=authConfiguration,this.oidcSecurityCommon=oidcSecurityCommon,this.onWellKnownEndpointsLoaded=new _angular_core.EventEmitter(!0),this.getWellKnownEndpoints=function(){var headers=new _angular_http.Headers;headers.append("Accept","application/json");var url=_this.authConfiguration.stsServer+"/.well-known/openid-configuration";return _this.authConfiguration.override_well_known_configuration&&(url=_this.authConfiguration.override_well_known_configuration_url),_this.http.get(url,{headers:headers}).map(function(res){return res.json()})}}return AuthWellKnownEndpoints.prototype.setupModule=function(){var _this=this,data=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_well_known_endpoints);this.oidcSecurityCommon.logDebug(data),data&&""!==data?(this.oidcSecurityCommon.logDebug("AuthWellKnownEndpoints already defined"),this.issuer=data.issuer,this.jwks_uri=data.jwks_uri,this.authorization_endpoint=data.authorization_endpoint,this.token_endpoint=data.token_endpoint,this.userinfo_endpoint=data.userinfo_endpoint,data.end_session_endpoint&&(this.end_session_endpoint=data.end_session_endpoint),data.check_session_iframe&&(this.check_session_iframe=data.check_session_iframe),data.revocation_endpoint&&(this.revocation_endpoint=data.revocation_endpoint),data.introspection_endpoint&&(this.introspection_endpoint=data.introspection_endpoint),this.onWellKnownEndpointsLoaded.emit()):(this.oidcSecurityCommon.logDebug("AuthWellKnownEndpoints first time, get from the server"),this.getWellKnownEndpoints().subscribe(function(data){_this.issuer=data.issuer,_this.jwks_uri=data.jwks_uri,_this.authorization_endpoint=data.authorization_endpoint,_this.token_endpoint=data.token_endpoint,_this.userinfo_endpoint=data.userinfo_endpoint,data.end_session_endpoint&&(_this.end_session_endpoint=data.end_session_endpoint),data.check_session_iframe&&(_this.check_session_iframe=data.check_session_iframe),data.revocation_endpoint&&(_this.revocation_endpoint=data.revocation_endpoint),data.introspection_endpoint&&(_this.introspection_endpoint=data.introspection_endpoint),_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_well_known_endpoints,data),_this.oidcSecurityCommon.logDebug(data),_this.onWellKnownEndpointsLoaded.emit()}))},AuthWellKnownEndpoints}();AuthWellKnownEndpoints.decorators=[{type:_angular_core.Injectable}],AuthWellKnownEndpoints.ctorParameters=function(){return[{type:_angular_http.Http},{type:AuthConfiguration},{type:OidcSecurityCommon}]},AuthWellKnownEndpoints.propDecorators={onWellKnownEndpointsLoaded:[{type:_angular_core.Output}]};var OidcSecurityCheckSession=function(){function OidcSecurityCheckSession(authConfiguration,oidcSecurityCommon,authWellKnownEndpoints){this.authConfiguration=authConfiguration,this.oidcSecurityCommon=oidcSecurityCommon,this.authWellKnownEndpoints=authWellKnownEndpoints,this.onCheckSessionChanged=new _angular_core.EventEmitter(!0)}return OidcSecurityCheckSession.prototype.init=function(){var _this=this;return window.parent.document.getElementById("myiFrameForCheckSession")?rxjs_Observable.Observable.empty():(this.sessionIframe=window.document.createElement("iframe"),this.sessionIframe.id="myiFrameForCheckSession",this.oidcSecurityCommon.logDebug(this.sessionIframe),this.sessionIframe.style.display="none",this.sessionIframe.src=this.authWellKnownEndpoints.check_session_iframe,window.document.body.appendChild(this.sessionIframe),this.iframeMessageEvent=this.messageHandler.bind(this),window.addEventListener("message",this.iframeMessageEvent,!1),rxjs_Observable.Observable.create(function(observer){_this.sessionIframe.onload=function(){observer.next(_this),observer.complete()}}))},OidcSecurityCheckSession.prototype.pollServerSession=function(clientId){var _this=this,source=rxjs_Observable.Observable.timer(3e3,3e3).timeInterval().pluck("interval").take(1e4);source.subscribe(function(){_this.oidcSecurityCommon.logDebug(_this.sessionIframe);var session_state=_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_session_state);session_state&&""!==session_state&&_this.sessionIframe.contentWindow.postMessage(clientId+" "+session_state,_this.authConfiguration.stsServer)},function(err){_this.oidcSecurityCommon.logError("pollServerSession error: "+err)},function(){_this.oidcSecurityCommon.logDebug("checksession pollServerSession completed")})},OidcSecurityCheckSession.prototype.messageHandler=function(e){e.origin===this.authConfiguration.stsServer&&e.source===this.sessionIframe.contentWindow&&("error"===e.data?this.oidcSecurityCommon.logWarning("error from checksession messageHandler"):"changed"===e.data?this.onCheckSessionChanged.emit():this.oidcSecurityCommon.logDebug(e.data+" from checksession messageHandler"))},OidcSecurityCheckSession}();OidcSecurityCheckSession.decorators=[{type:_angular_core.Injectable}],OidcSecurityCheckSession.ctorParameters=function(){return[{type:AuthConfiguration},{type:OidcSecurityCommon},{type:AuthWellKnownEndpoints}]},OidcSecurityCheckSession.propDecorators={onCheckSessionChanged:[{type:_angular_core.Output}]};var OidcSecuritySilentRenew=function(){function OidcSecuritySilentRenew(oidcSecurityCommon){this.oidcSecurityCommon=oidcSecurityCommon}return OidcSecuritySilentRenew.prototype.initRenew=function(){var existsparent=void 0;try{var parentdoc=window.parent.document;if(!parentdoc)throw new Error("Unaccessible");existsparent=parentdoc.getElementById("myiFrameForSilentRenew")}catch(e){}var exists=window.document.getElementById("myiFrameForSilentRenew");existsparent?this.sessionIframe=existsparent:exists&&(this.sessionIframe=exists),exists||existsparent||(this.sessionIframe=window.document.createElement("iframe"),this.sessionIframe.id="myiFrameForSilentRenew",this.oidcSecurityCommon.logDebug(this.sessionIframe),this.sessionIframe.style.display="none",window.document.body.appendChild(this.sessionIframe))},OidcSecuritySilentRenew.prototype.startRenew=function(url){var _this=this,existsparent=void 0;try{var parentdoc=window.parent.document;if(!parentdoc)throw new Error("Unaccessible");existsparent=parentdoc.getElementById("myiFrameForSilentRenew")}catch(e){}var exists=window.document.getElementById("myiFrameForSilentRenew");return existsparent?this.sessionIframe=existsparent:exists&&(this.sessionIframe=exists),this.oidcSecurityCommon.logDebug("startRenew for URL:"+url),this.sessionIframe.src=url,rxjs_Observable.Observable.create(function(observer){_this.sessionIframe.onload=function(){observer.next(_this),observer.complete()}})},OidcSecuritySilentRenew}();OidcSecuritySilentRenew.decorators=[{type:_angular_core.Injectable}],OidcSecuritySilentRenew.ctorParameters=function(){return[{type:OidcSecurityCommon}]};var OidcSecurityUserService=function(){function OidcSecurityUserService(http,authConfiguration,oidcSecurityCommon,authWellKnownEndpoints){var _this=this;this.http=http,this.authConfiguration=authConfiguration,this.oidcSecurityCommon=oidcSecurityCommon,this.authWellKnownEndpoints=authWellKnownEndpoints,this.userData="",this.getIdentityUserData=function(){var headers=new _angular_http.Headers;headers.append("Accept","application/json");var token=_this.oidcSecurityCommon.getAccessToken();return""!==token&&headers.append("Authorization","Bearer "+decodeURIComponent(token)),_this.http.get(_this.authWellKnownEndpoints.userinfo_endpoint,{headers:headers,body:""}).map(function(res){return res.json()})}}return OidcSecurityUserService.prototype.initUserData=function(){var _this=this;return this.getIdentityUserData().map(function(data){return _this.userData=data})},OidcSecurityUserService}();OidcSecurityUserService.decorators=[{type:_angular_core.Injectable}],OidcSecurityUserService.ctorParameters=function(){return[{type:_angular_http.Http},{type:AuthConfiguration},{type:OidcSecurityCommon},{type:AuthWellKnownEndpoints}]};var AuthorizationResult={};AuthorizationResult.authorized=1,AuthorizationResult.forbidden=2,AuthorizationResult.unauthorized=3,AuthorizationResult[AuthorizationResult.authorized]="authorized",AuthorizationResult[AuthorizationResult.forbidden]="forbidden",AuthorizationResult[AuthorizationResult.unauthorized]="unauthorized";var OidcSecurityService=function(){function OidcSecurityService(platformId,http,authConfiguration,router,oidcSecurityCheckSession,oidcSecuritySilentRenew,oidcSecurityUserService,oidcSecurityCommon,authWellKnownEndpoints){this.platformId=platformId,this.http=http,this.authConfiguration=authConfiguration,this.router=router,this.oidcSecurityCheckSession=oidcSecurityCheckSession,this.oidcSecuritySilentRenew=oidcSecuritySilentRenew,this.oidcSecurityUserService=oidcSecurityUserService,this.oidcSecurityCommon=oidcSecurityCommon,this.authWellKnownEndpoints=authWellKnownEndpoints,this.onModuleSetup=new _angular_core.EventEmitter(!0),this.onAuthorizationResult=new _angular_core.EventEmitter(!0),this.moduleSetup=!1,this._isAuthorized=new rxjs_BehaviorSubject.BehaviorSubject(!1),this.lastUserData=void 0,this._userData=new rxjs_BehaviorSubject.BehaviorSubject(""),this.authWellKnownEndpointsLoaded=!1}return OidcSecurityService.prototype.setupModule=function(openIDImplicitFlowConfiguration){var _this=this;this.authConfiguration.init(openIDImplicitFlowConfiguration),this.oidcSecurityValidation=new OidcSecurityValidation(this.oidcSecurityCommon),this.oidcSecurityCheckSession.onCheckSessionChanged.subscribe(function(){_this.onCheckSessionChanged()}),this.authWellKnownEndpoints.onWellKnownEndpointsLoaded.subscribe(function(){_this.onWellKnownEndpointsLoaded()}),this._userData.subscribe(function(){_this.onUserDataChanged()}),this.oidcSecurityCommon.setupModule(),""!==this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_user_data)&&this.setUserData(this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_user_data)),""!==this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_is_authorized)&&(this.setIsAuthorized(this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_is_authorized)),this.runTokenValidation()),this.oidcSecurityCommon.logDebug("STS server: "+this.authConfiguration.stsServer),_angular_common.isPlatformBrowser(this.platformId)?(this.authWellKnownEndpoints.onWellKnownEndpointsLoaded.subscribe(function(){_this.moduleSetup=!0,_this.onModuleSetup.emit()}),this.authWellKnownEndpoints.setupModule(),this.authConfiguration.silent_renew&&this.oidcSecuritySilentRenew.initRenew(),this.authConfiguration.start_checksession&&this.oidcSecurityCheckSession.init().subscribe(function(){_this.oidcSecurityCheckSession.pollServerSession(_this.authConfiguration.client_id)})):(this.moduleSetup=!0,this.onModuleSetup.emit())},OidcSecurityService.prototype.getUserData=function(){return this._userData.asObservable()},OidcSecurityService.prototype.setUserData=function(userData){this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_user_data,userData),this._userData.next(userData)},OidcSecurityService.prototype.getIsAuthorized=function(){return this._isAuthorized.asObservable()},OidcSecurityService.prototype.setIsAuthorized=function(isAuthorized){this._isAuthorizedValue=isAuthorized,this._isAuthorized.next(isAuthorized)},OidcSecurityService.prototype.getToken=function(){if(!this._isAuthorizedValue)return"";var token=this.oidcSecurityCommon.getAccessToken();return decodeURIComponent(token)},OidcSecurityService.prototype.getIdToken=function(){if(!this._isAuthorizedValue)return"";var token=this.oidcSecurityCommon.getIdToken();return decodeURIComponent(token)},OidcSecurityService.prototype.getPayloadFromIdToken=function(encode){void 0===encode&&(encode=!1);var token=this.getIdToken();return this.oidcSecurityValidation.getPayloadFromToken(token,encode)},OidcSecurityService.prototype.setState=function(state){this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_state_control,state)},OidcSecurityService.prototype.getState=function(){return this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control)},OidcSecurityService.prototype.setCustomRequestParameters=function(params){this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_custom_request_params,params)},OidcSecurityService.prototype.authorize=function(){var data=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_well_known_endpoints);if(data&&""!==data&&(this.authWellKnownEndpointsLoaded=!0),!this.authWellKnownEndpointsLoaded)return void this.oidcSecurityCommon.logError("Well known endpoints must be loaded before user can login!")
;if(this.oidcSecurityValidation.config_validate_response_type(this.authConfiguration.response_type)){this.resetAuthorizationData(!1),this.oidcSecurityCommon.logDebug("BEGIN Authorize, no auth data");var state=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control);""!==state&&null!==state||(state=Date.now()+""+Math.random(),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_state_control,state));var nonce="N"+Math.random()+Date.now();this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_nonce,nonce),this.oidcSecurityCommon.logDebug("AuthorizedController created. local state: "+this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control));var url=this.createAuthorizeUrl(nonce,state,this.authWellKnownEndpoints.authorization_endpoint);window.location.href=url}},OidcSecurityService.prototype.authorizedCallback=function(hash){var _this=this,silentRenew=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_silent_renew_running),isRenewProcess="running"===silentRenew;this.oidcSecurityCommon.logDebug("BEGIN authorizedCallback, no auth data"),this.resetAuthorizationData(isRenewProcess),hash=hash||window.location.hash.substr(1);var result=hash.split("&").reduce(function(result,item){var parts=item.split("=");return result[parts[0]]=parts[1],result},{});this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_result,result),this.oidcSecurityCommon.logDebug(result),this.oidcSecurityCommon.logDebug("authorizedCallback created, begin token validation");var decoded_id_token,access_token="",id_token="",authResponseIsValid=!1;this.getSigningKeys().subscribe(function(jwtKeys){if(_this.jwtKeys=jwtKeys,!result.error)if(_this.oidcSecurityValidation.validateStateFromHashCallback(result.state,_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_auth_state_control))){"id_token token"===_this.authConfiguration.response_type&&(access_token=result.access_token),id_token=result.id_token;decoded_id_token=_this.oidcSecurityValidation.getPayloadFromToken(id_token,!1),_this.oidcSecurityValidation.getHeaderFromToken(id_token,!1),_this.oidcSecurityValidation.validate_signature_id_token(id_token,_this.jwtKeys)?_this.oidcSecurityValidation.validate_id_token_nonce(decoded_id_token,_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_auth_nonce))?_this.oidcSecurityValidation.validate_required_id_token(decoded_id_token)?_this.oidcSecurityValidation.validate_id_token_iat_max_offset(decoded_id_token,_this.authConfiguration.max_id_token_iat_offset_allowed_in_seconds)?_this.oidcSecurityValidation.validate_id_token_iss(decoded_id_token,_this.authWellKnownEndpoints.issuer)?_this.oidcSecurityValidation.validate_id_token_aud(decoded_id_token,_this.authConfiguration.client_id)?_this.oidcSecurityValidation.validate_id_token_exp_not_expired(decoded_id_token)?"id_token token"===_this.authConfiguration.response_type?_this.oidcSecurityValidation.validate_id_token_at_hash(access_token,decoded_id_token.at_hash)||!access_token?(authResponseIsValid=!0,_this.successful_validation()):_this.oidcSecurityCommon.logWarning("authorizedCallback incorrect at_hash"):(authResponseIsValid=!0,_this.successful_validation()):_this.oidcSecurityCommon.logWarning("authorizedCallback token expired"):_this.oidcSecurityCommon.logWarning("authorizedCallback incorrect aud"):_this.oidcSecurityCommon.logWarning("authorizedCallback incorrect iss does not match authWellKnownEndpoints issuer"):_this.oidcSecurityCommon.logWarning("authorizedCallback Validation, iat rejected id_token was issued too far away from the current time"):_this.oidcSecurityCommon.logDebug("authorizedCallback Validation, one of the REQUIRED properties missing from id_token"):_this.oidcSecurityCommon.logWarning("authorizedCallback incorrect nonce"):_this.oidcSecurityCommon.logDebug("authorizedCallback Signature validation failed id_token")}else _this.oidcSecurityCommon.logWarning("authorizedCallback incorrect state");_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_silent_renew_running,""),authResponseIsValid?(_this.setAuthorizationData(access_token,id_token),_this.authConfiguration.auto_userinfo?_this.getUserinfo(isRenewProcess,result,id_token,decoded_id_token).subscribe(function(response){response?_this.authConfiguration.trigger_authorization_result_event?_this.onAuthorizationResult.emit(AuthorizationResult.authorized):_this.router.navigate([_this.authConfiguration.post_login_route]):_this.authConfiguration.trigger_authorization_result_event?_this.onAuthorizationResult.emit(AuthorizationResult.unauthorized):_this.router.navigate([_this.authConfiguration.unauthorized_route])}):(_this.runTokenValidation(),_this.authConfiguration.trigger_authorization_result_event?_this.onAuthorizationResult.emit(AuthorizationResult.authorized):_this.router.navigate([_this.authConfiguration.post_login_route]))):(_this.oidcSecurityCommon.logDebug("authorizedCallback, token(s) validation failed, resetting"),_this.resetAuthorizationData(!1),_this.authConfiguration.trigger_authorization_result_event?_this.onAuthorizationResult.emit(AuthorizationResult.unauthorized):_this.router.navigate([_this.authConfiguration.unauthorized_route]))})},OidcSecurityService.prototype.getUserinfo=function(isRenewProcess,result,id_token,decoded_id_token){var _this=this;return void 0===isRenewProcess&&(isRenewProcess=!1),result=result||this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_result),id_token=id_token||this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_id_token),decoded_id_token=decoded_id_token||this.oidcSecurityValidation.getPayloadFromToken(id_token,!1),new rxjs_Observable.Observable(function(observer){"id_token token"===_this.authConfiguration.response_type?isRenewProcess?(_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_session_state,result.session_state),observer.next(!0),observer.complete()):_this.oidcSecurityUserService.initUserData().subscribe(function(){_this.oidcSecurityCommon.logDebug("authorizedCallback id_token token flow"),_this.oidcSecurityValidation.validate_userdata_sub_id_token(decoded_id_token.sub,_this.oidcSecurityUserService.userData.sub)?(_this.setUserData(_this.oidcSecurityUserService.userData),_this.oidcSecurityCommon.logDebug(_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_access_token)),_this.oidcSecurityCommon.logDebug(_this.oidcSecurityUserService.userData),_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_session_state,result.session_state),_this.runTokenValidation(),observer.next(!0)):(_this.oidcSecurityCommon.logWarning("authorizedCallback, User data sub does not match sub in id_token"),_this.oidcSecurityCommon.logDebug("authorizedCallback, token(s) validation failed, resetting"),_this.resetAuthorizationData(!1),observer.next(!1)),observer.complete()}):(_this.oidcSecurityCommon.logDebug("authorizedCallback id_token flow"),_this.oidcSecurityCommon.logDebug(_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_access_token)),_this.oidcSecurityUserService.userData=decoded_id_token,_this.setUserData(_this.oidcSecurityUserService.userData),_this.oidcSecurityCommon.store(_this.oidcSecurityCommon.storage_session_state,result.session_state),isRenewProcess||_this.runTokenValidation(),observer.next(!0),observer.complete())})},OidcSecurityService.prototype.logoff=function(){if(this.oidcSecurityCommon.logDebug("BEGIN Authorize, no auth data"),this.authWellKnownEndpoints.end_session_endpoint){var end_session_endpoint=this.authWellKnownEndpoints.end_session_endpoint,id_token_hint=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_id_token),url=this.createEndSessionUrl(end_session_endpoint,id_token_hint);this.resetAuthorizationData(!1),this.authConfiguration.start_checksession&&this.checkSessionChanged?this.oidcSecurityCommon.logDebug("only local login cleaned up, server session has changed"):window.location.href=url}else this.resetAuthorizationData(!1),this.oidcSecurityCommon.logDebug("only local login cleaned up, no end_session_endpoint")},OidcSecurityService.prototype.successful_validation=function(){this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_nonce,""),this.authConfiguration.auto_clean_state_after_authentication&&this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_state_control,""),this.oidcSecurityCommon.logDebug("AuthorizedCallback token(s) validated, continue")},OidcSecurityService.prototype.refreshSession=function(){this.oidcSecurityCommon.logDebug("BEGIN refresh session Authorize");var state=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control);""!==state&&null!==state||(state=Date.now()+""+Math.random(),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_state_control,state));var nonce="N"+Math.random()+Date.now();this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_auth_nonce,nonce),this.oidcSecurityCommon.logDebug("RefreshSession created. adding myautostate: "+this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_auth_state_control));var url=this.createAuthorizeUrl(nonce,state,this.authWellKnownEndpoints.authorization_endpoint);this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_silent_renew_running,"running"),this.oidcSecuritySilentRenew.startRenew(url)},OidcSecurityService.prototype.setAuthorizationData=function(access_token,id_token){""!==this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_access_token)&&this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_access_token,""),this.oidcSecurityCommon.logDebug(access_token),this.oidcSecurityCommon.logDebug(id_token),this.oidcSecurityCommon.logDebug("storing to storage, getting the roles"),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_access_token,access_token),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_id_token,id_token),this.setIsAuthorized(!0),this.oidcSecurityCommon.store(this.oidcSecurityCommon.storage_is_authorized,!0)},OidcSecurityService.prototype.createAuthorizeUrl=function(nonce,state,authorization_endpoint){var urlParts=authorization_endpoint.split("?"),authorizationUrl=urlParts[0],params=new _angular_http.URLSearchParams(urlParts[1]);params.set("client_id",this.authConfiguration.client_id),params.set("redirect_uri",this.authConfiguration.redirect_url),params.set("response_type",this.authConfiguration.response_type),params.set("scope",this.authConfiguration.scope),params.set("nonce",nonce),params.set("state",state),this.authConfiguration.hd_param&&params.set("hd",this.authConfiguration.hd_param);var customParams=Object.assign({},this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_custom_request_params));return Object.keys(customParams).forEach(function(key){params.set(key,customParams[key])}),authorizationUrl+"?"+params},OidcSecurityService.prototype.createEndSessionUrl=function(end_session_endpoint,id_token_hint){var urlParts=end_session_endpoint.split("?"),authorizationEndsessionUrl=urlParts[0],params=new _angular_http.URLSearchParams(urlParts[1]);return params.set("id_token_hint",id_token_hint),params.set("post_logout_redirect_uri",this.authConfiguration.post_logout_redirect_uri),authorizationEndsessionUrl+"?"+params},OidcSecurityService.prototype.resetAuthorizationData=function(isRenewProcess){isRenewProcess||(this.authConfiguration.auto_userinfo&&this.setUserData(""),this.setIsAuthorized(!1),this.oidcSecurityCommon.resetStorageData(isRenewProcess),this.checkSessionChanged=!1)},OidcSecurityService.prototype.handleError=function(error){if(this.oidcSecurityCommon.logError(error),403==error.status)this.authConfiguration.trigger_authorization_result_event?this.onAuthorizationResult.emit(AuthorizationResult.unauthorized):this.router.navigate([this.authConfiguration.forbidden_route]);else if(401==error.status){var silentRenew=this.oidcSecurityCommon.retrieve(this.oidcSecurityCommon.storage_silent_renew_running);this.resetAuthorizationData(silentRenew),this.authConfiguration.trigger_authorization_result_event?this.onAuthorizationResult.emit(AuthorizationResult.unauthorized):this.router.navigate([this.authConfiguration.unauthorized_route])}},OidcSecurityService.prototype.onCheckSessionChanged=function(){this.oidcSecurityCommon.logDebug("onCheckSessionChanged"),this.checkSessionChanged=!0},OidcSecurityService.prototype.onWellKnownEndpointsLoaded=function(){this.oidcSecurityCommon.logDebug("onWellKnownEndpointsLoaded"),this.authWellKnownEndpointsLoaded=!0},OidcSecurityService.prototype.onUserDataChanged=function(){this.oidcSecurityCommon.logDebug("onUserDataChanged: last = "+this.lastUserData+", new = "+this._userData.value),this.lastUserData&&!this._userData.value&&this.oidcSecurityCommon.logDebug("onUserDataChanged: Logout detected."),this.lastUserData=this._userData.value},OidcSecurityService.prototype.runGetSigningKeys=function(){var _this=this;this.getSigningKeys().subscribe(function(jwtKeys){return _this.jwtKeys=jwtKeys},function(error){return _this.errorMessage=error})},OidcSecurityService.prototype.getSigningKeys=function(){return this.oidcSecurityCommon.logDebug("jwks_uri: "+this.authWellKnownEndpoints.jwks_uri),this.http.get(this.authWellKnownEndpoints.jwks_uri).map(this.extractData).catch(this.handleErrorGetSigningKeys)},OidcSecurityService.prototype.extractData=function(res){return res.json()},OidcSecurityService.prototype.handleErrorGetSigningKeys=function(error){var errMsg;if(error instanceof _angular_http.Response){var body=error.json()||{},err=body.error||JSON.stringify(body);errMsg=error.status+" - "+(error.statusText||"")+" "+err}else errMsg=error.message?error.message:error.toString();return console.error(errMsg),rxjs_Observable.Observable.throw(errMsg)},OidcSecurityService.prototype.runTokenValidation=function(){var _this=this;if(!this.runTokenValidationRunning){this.runTokenValidationRunning=!0;var source=rxjs_Observable.Observable.timer(5e3,3e3).timeInterval().pluck("interval").take(1e4);source.subscribe(function(){_this._userData.value&&_this.oidcSecurityValidation.isTokenExpired(_this.oidcSecurityCommon.retrieve(_this.oidcSecurityCommon.storage_id_token),_this.authConfiguration.silent_renew_offset_in_seconds)&&(_this.oidcSecurityCommon.logDebug("IsAuthorized: id_token isTokenExpired, start silent renew if active"),_this.authConfiguration.silent_renew?_this.refreshSession():_this.resetAuthorizationData(!1))},function(err){_this.oidcSecurityCommon.logError("Error: "+err)},function(){_this.oidcSecurityCommon.logDebug("Completed")})}},OidcSecurityService}();OidcSecurityService.decorators=[{type:_angular_core.Injectable}],OidcSecurityService.ctorParameters=function(){return[{type:Object,decorators:[{type:_angular_core.Inject,args:[_angular_core.PLATFORM_ID]}]},{type:_angular_http.Http},{type:AuthConfiguration},{type:_angular_router.Router},{type:OidcSecurityCheckSession},{type:OidcSecuritySilentRenew},{type:OidcSecurityUserService},{type:OidcSecurityCommon},{type:AuthWellKnownEndpoints}]},OidcSecurityService.propDecorators={onModuleSetup:[{type:_angular_core.Output}],onAuthorizationResult:[{type:_angular_core.Output}]};var AuthModule=function(){function AuthModule(){}return AuthModule.forRoot=function(token){return void 0===token&&(token={}),{ngModule:AuthModule,providers:[OidcSecurityService,OidcSecurityValidation,OidcSecurityCheckSession,OidcSecuritySilentRenew,OidcSecurityUserService,OidcSecurityCommon,AuthConfiguration,DefaultConfiguration,AuthWellKnownEndpoints,{provide:OidcSecurityStorage,useClass:token.storage||BrowserStorage}]}},AuthModule.forChild=function(token){return void 0===token&&(token={}),{ngModule:AuthModule,providers:[OidcSecurityService,OidcSecurityValidation,OidcSecurityCheckSession,OidcSecuritySilentRenew,OidcSecurityUserService,OidcSecurityCommon,AuthConfiguration,AuthWellKnownEndpoints,{provide:OidcSecurityStorage,useClass:token.storage||BrowserStorage}]}},AuthModule}();AuthModule.decorators=[{type:_angular_core.NgModule}],AuthModule.ctorParameters=function(){return[]},exports.OidcSecurityService=OidcSecurityService,exports.OidcSecurityValidation=OidcSecurityValidation,exports.OidcSecurityCheckSession=OidcSecurityCheckSession,exports.OidcSecuritySilentRenew=OidcSecuritySilentRenew,exports.OidcSecurityUserService=OidcSecurityUserService,exports.OidcSecurityCommon=OidcSecurityCommon,exports.OidcSecurityStorage=OidcSecurityStorage,exports.BrowserStorage=BrowserStorage,exports.AuthWellKnownEndpoints=AuthWellKnownEndpoints,exports.AuthConfiguration=AuthConfiguration,exports.OpenIDImplicitFlowConfiguration=OpenIDImplicitFlowConfiguration,exports.DefaultConfiguration=DefaultConfiguration,exports.AuthModule=AuthModule,exports.AuthorizationResult=AuthorizationResult,Object.defineProperty(exports,"__esModule",{value:!0})});
//# sourceMappingURL=angular-auth-oidc-client.umd.min.js.map

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

{"__symbolic":"module","version":3,"metadata":{"OidcSecurityService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"onModuleSetup":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onAuthorizationResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID"}]}],null,null,null,null,null,null,null,null],"parameters":[{"__symbolic":"reference","name":"Object"},{"__symbolic":"reference","module":"@angular/http","name":"Http"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","module":"@angular/router","name":"Router"},{"__symbolic":"reference","name":"OidcSecurityCheckSession"},{"__symbolic":"reference","name":"OidcSecuritySilentRenew"},{"__symbolic":"reference","name":"OidcSecurityUserService"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"}]}],"setupModule":[{"__symbolic":"method"}],"getUserData":[{"__symbolic":"method"}],"setUserData":[{"__symbolic":"method"}],"getIsAuthorized":[{"__symbolic":"method"}],"setIsAuthorized":[{"__symbolic":"method"}],"getToken":[{"__symbolic":"method"}],"getIdToken":[{"__symbolic":"method"}],"getPayloadFromIdToken":[{"__symbolic":"method"}],"setState":[{"__symbolic":"method"}],"getState":[{"__symbolic":"method"}],"setCustomRequestParameters":[{"__symbolic":"method"}],"authorize":[{"__symbolic":"method"}],"authorizedCallback":[{"__symbolic":"method"}],"getUserinfo":[{"__symbolic":"method"}],"logoff":[{"__symbolic":"method"}],"successful_validation":[{"__symbolic":"method"}],"refreshSession":[{"__symbolic":"method"}],"setAuthorizationData":[{"__symbolic":"method"}],"createAuthorizeUrl":[{"__symbolic":"method"}],"createEndSessionUrl":[{"__symbolic":"method"}],"resetAuthorizationData":[{"__symbolic":"method"}],"handleError":[{"__symbolic":"method"}],"onCheckSessionChanged":[{"__symbolic":"method"}],"onWellKnownEndpointsLoaded":[{"__symbolic":"method"}],"runGetSigningKeys":[{"__symbolic":"method"}],"getSigningKeys":[{"__symbolic":"method"}],"extractData":[{"__symbolic":"method"}],"handleErrorGetSigningKeys":[{"__symbolic":"method"}],"runTokenValidatation":[{"__symbolic":"method"}]}},"OidcSecurityValidation":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"OidcSecurityCommon"}]}],"isTokenExpired":[{"__symbolic":"method"}],"validate_id_token_exp_not_expired":[{"__symbolic":"method"}],"validate_required_id_token":[{"__symbolic":"method"}],"validate_id_token_iat_max_offset":[{"__symbolic":"method"}],"validate_id_token_nonce":[{"__symbolic":"method"}],"validate_id_token_iss":[{"__symbolic":"method"}],"validate_id_token_aud":[{"__symbolic":"method"}],"validateStateFromHashCallback":[{"__symbolic":"method"}],"validate_userdata_sub_id_token":[{"__symbolic":"method"}],"getPayloadFromToken":[{"__symbolic":"method"}],"getHeaderFromToken":[{"__symbolic":"method"}],"getSignatureFromToken":[{"__symbolic":"method"}],"validate_signature_id_token":[{"__symbolic":"method"}],"config_validate_response_type":[{"__symbolic":"method"}],"validate_id_token_at_hash":[{"__symbolic":"method"}],"generate_at_hash":[{"__symbolic":"method"}],"getTokenExpirationDate":[{"__symbolic":"method"}],"urlBase64Decode":[{"__symbolic":"method"}]}},"OidcSecurityCheckSession":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"onCheckSessionChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"}]}],"init":[{"__symbolic":"method"}],"pollServerSession":[{"__symbolic":"method"}],"messageHandler":[{"__symbolic":"method"}]}},"OidcSecuritySilentRenew":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"OidcSecurityCommon"}]}],"initRenew":[{"__symbolic":"method"}],"startRenew":[{"__symbolic":"method"}]}},"OidcSecurityUserService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Http"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"}]}],"initUserData":[{"__symbolic":"method"}],"handleError":[{"__symbolic":"method"}]}},"OidcSecurityCommon":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"OidcSecurityStorage"}]}],"setupModule":[{"__symbolic":"method"}],"retrieve":[{"__symbolic":"method"}],"store":[{"__symbolic":"method"}],"resetStorageData":[{"__symbolic":"method"}],"getAccessToken":[{"__symbolic":"method"}],"getIdToken":[{"__symbolic":"method"}],"logError":[{"__symbolic":"method"}],"logWarning":[{"__symbolic":"method"}],"logDebug":[{"__symbolic":"method"}]}},"OidcSecurityStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"read":[{"__symbolic":"method"}],"write":[{"__symbolic":"method"}]}},"BrowserStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AuthConfiguration"}]}],"read":[{"__symbolic":"method"}],"write":[{"__symbolic":"method"}]}},"AuthWellKnownEndpoints":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"onWellKnownEndpointsLoaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Http"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"OidcSecurityCommon"}]}],"setupModule":[{"__symbolic":"method"}]}},"AuthConfiguration":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"DefaultConfiguration"}]}],"init":[{"__symbolic":"method"}]}},"OpenIDImplicitFlowConfiguration":{"__symbolic":"class","members":{}},"DefaultConfiguration":{"__symbolic":"class","members":{}},"AuthModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"}}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["token"],"defaults":[{}],"value":{"ngModule":{"__symbolic":"reference","name":"AuthModule"},"providers":[{"__symbolic":"reference","name":"OidcSecurityService"},{"__symbolic":"reference","name":"OidcSecurityValidation"},{"__symbolic":"reference","name":"OidcSecurityCheckSession"},{"__symbolic":"reference","name":"OidcSecuritySilentRenew"},{"__symbolic":"reference","name":"OidcSecurityUserService"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"DefaultConfiguration"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"},{"provide":{"__symbolic":"reference","name":"OidcSecurityStorage"},"useClass":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"token"},"member":"storage"},"right":{"__symbolic":"reference","name":"BrowserStorage"}}}]}},"forChild":{"__symbolic":"function","parameters":["token"],"defaults":[{}],"value":{"ngModule":{"__symbolic":"reference","name":"AuthModule"},"providers":[{"__symbolic":"reference","name":"OidcSecurityService"},{"__symbolic":"reference","name":"OidcSecurityValidation"},{"__symbolic":"reference","name":"OidcSecurityCheckSession"},{"__symbolic":"reference","name":"OidcSecuritySilentRenew"},{"__symbolic":"reference","name":"OidcSecurityUserService"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"},{"provide":{"__symbolic":"reference","name":"OidcSecurityStorage"},"useClass":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"token"},"member":"storage"},"right":{"__symbolic":"reference","name":"BrowserStorage"}}}]}}}},"AuthorizationResult":{"authorized":1,"forbidden":2,"unauthorized":3}},"origins":{"OidcSecurityService":"./src/services/oidc.security.service","OidcSecurityValidation":"./src/services/oidc.security.validation","OidcSecurityCheckSession":"./src/services/oidc.security.check-session","OidcSecuritySilentRenew":"./src/services/oidc.security.silent-renew","OidcSecurityUserService":"./src/services/oidc.security.user-service","OidcSecurityCommon":"./src/services/oidc.security.common","OidcSecurityStorage":"./src/services/oidc.security.storage","BrowserStorage":"./src/services/oidc.security.storage","AuthWellKnownEndpoints":"./src/services/auth.well-known-endpoints","AuthConfiguration":"./src/modules/auth.configuration","OpenIDImplicitFlowConfiguration":"./src/modules/auth.configuration","DefaultConfiguration":"./src/modules/auth.configuration","AuthModule":"./src/modules/auth.module","AuthorizationResult":"./src/services/authorization-result.enum"},"importAs":"angular-auth-oidc-client"}
{"__symbolic":"module","version":3,"metadata":{"OidcSecurityService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"onModuleSetup":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onAuthorizationResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID"}]}],null,null,null,null,null,null,null,null],"parameters":[{"__symbolic":"reference","name":"Object"},{"__symbolic":"reference","module":"@angular/http","name":"Http"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","module":"@angular/router","name":"Router"},{"__symbolic":"reference","name":"OidcSecurityCheckSession"},{"__symbolic":"reference","name":"OidcSecuritySilentRenew"},{"__symbolic":"reference","name":"OidcSecurityUserService"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"}]}],"setupModule":[{"__symbolic":"method"}],"getUserData":[{"__symbolic":"method"}],"setUserData":[{"__symbolic":"method"}],"getIsAuthorized":[{"__symbolic":"method"}],"setIsAuthorized":[{"__symbolic":"method"}],"getToken":[{"__symbolic":"method"}],"getIdToken":[{"__symbolic":"method"}],"getPayloadFromIdToken":[{"__symbolic":"method"}],"setState":[{"__symbolic":"method"}],"getState":[{"__symbolic":"method"}],"setCustomRequestParameters":[{"__symbolic":"method"}],"authorize":[{"__symbolic":"method"}],"authorizedCallback":[{"__symbolic":"method"}],"getUserinfo":[{"__symbolic":"method"}],"logoff":[{"__symbolic":"method"}],"successful_validation":[{"__symbolic":"method"}],"refreshSession":[{"__symbolic":"method"}],"setAuthorizationData":[{"__symbolic":"method"}],"createAuthorizeUrl":[{"__symbolic":"method"}],"createEndSessionUrl":[{"__symbolic":"method"}],"resetAuthorizationData":[{"__symbolic":"method"}],"handleError":[{"__symbolic":"method"}],"onCheckSessionChanged":[{"__symbolic":"method"}],"onWellKnownEndpointsLoaded":[{"__symbolic":"method"}],"onUserDataChanged":[{"__symbolic":"method"}],"runGetSigningKeys":[{"__symbolic":"method"}],"getSigningKeys":[{"__symbolic":"method"}],"extractData":[{"__symbolic":"method"}],"handleErrorGetSigningKeys":[{"__symbolic":"method"}],"runTokenValidation":[{"__symbolic":"method"}]}},"OidcSecurityValidation":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"OidcSecurityCommon"}]}],"isTokenExpired":[{"__symbolic":"method"}],"validate_id_token_exp_not_expired":[{"__symbolic":"method"}],"validate_required_id_token":[{"__symbolic":"method"}],"validate_id_token_iat_max_offset":[{"__symbolic":"method"}],"validate_id_token_nonce":[{"__symbolic":"method"}],"validate_id_token_iss":[{"__symbolic":"method"}],"validate_id_token_aud":[{"__symbolic":"method"}],"validateStateFromHashCallback":[{"__symbolic":"method"}],"validate_userdata_sub_id_token":[{"__symbolic":"method"}],"getPayloadFromToken":[{"__symbolic":"method"}],"getHeaderFromToken":[{"__symbolic":"method"}],"getSignatureFromToken":[{"__symbolic":"method"}],"validate_signature_id_token":[{"__symbolic":"method"}],"config_validate_response_type":[{"__symbolic":"method"}],"validate_id_token_at_hash":[{"__symbolic":"method"}],"generate_at_hash":[{"__symbolic":"method"}],"getTokenExpirationDate":[{"__symbolic":"method"}],"urlBase64Decode":[{"__symbolic":"method"}]}},"OidcSecurityCheckSession":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"onCheckSessionChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"}]}],"init":[{"__symbolic":"method"}],"pollServerSession":[{"__symbolic":"method"}],"messageHandler":[{"__symbolic":"method"}]}},"OidcSecuritySilentRenew":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"OidcSecurityCommon"}]}],"initRenew":[{"__symbolic":"method"}],"startRenew":[{"__symbolic":"method"}]}},"OidcSecurityUserService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Http"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"}]}],"initUserData":[{"__symbolic":"method"}]}},"OidcSecurityCommon":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"OidcSecurityStorage"}]}],"setupModule":[{"__symbolic":"method"}],"retrieve":[{"__symbolic":"method"}],"store":[{"__symbolic":"method"}],"resetStorageData":[{"__symbolic":"method"}],"getAccessToken":[{"__symbolic":"method"}],"getIdToken":[{"__symbolic":"method"}],"logError":[{"__symbolic":"method"}],"logWarning":[{"__symbolic":"method"}],"logDebug":[{"__symbolic":"method"}]}},"OidcSecurityStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"read":[{"__symbolic":"method"}],"write":[{"__symbolic":"method"}]}},"BrowserStorage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AuthConfiguration"}]}],"read":[{"__symbolic":"method"}],"write":[{"__symbolic":"method"}]}},"AuthWellKnownEndpoints":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"onWellKnownEndpointsLoaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Http"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"OidcSecurityCommon"}]}],"setupModule":[{"__symbolic":"method"}]}},"AuthConfiguration":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"DefaultConfiguration"}]}],"init":[{"__symbolic":"method"}]}},"OpenIDImplicitFlowConfiguration":{"__symbolic":"class","members":{}},"DefaultConfiguration":{"__symbolic":"class","members":{}},"AuthModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"}}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["token"],"defaults":[{}],"value":{"ngModule":{"__symbolic":"reference","name":"AuthModule"},"providers":[{"__symbolic":"reference","name":"OidcSecurityService"},{"__symbolic":"reference","name":"OidcSecurityValidation"},{"__symbolic":"reference","name":"OidcSecurityCheckSession"},{"__symbolic":"reference","name":"OidcSecuritySilentRenew"},{"__symbolic":"reference","name":"OidcSecurityUserService"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"DefaultConfiguration"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"},{"provide":{"__symbolic":"reference","name":"OidcSecurityStorage"},"useClass":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"token"},"member":"storage"},"right":{"__symbolic":"reference","name":"BrowserStorage"}}}]}},"forChild":{"__symbolic":"function","parameters":["token"],"defaults":[{}],"value":{"ngModule":{"__symbolic":"reference","name":"AuthModule"},"providers":[{"__symbolic":"reference","name":"OidcSecurityService"},{"__symbolic":"reference","name":"OidcSecurityValidation"},{"__symbolic":"reference","name":"OidcSecurityCheckSession"},{"__symbolic":"reference","name":"OidcSecuritySilentRenew"},{"__symbolic":"reference","name":"OidcSecurityUserService"},{"__symbolic":"reference","name":"OidcSecurityCommon"},{"__symbolic":"reference","name":"AuthConfiguration"},{"__symbolic":"reference","name":"AuthWellKnownEndpoints"},{"provide":{"__symbolic":"reference","name":"OidcSecurityStorage"},"useClass":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"token"},"member":"storage"},"right":{"__symbolic":"reference","name":"BrowserStorage"}}}]}}}},"AuthorizationResult":{"authorized":1,"forbidden":2,"unauthorized":3}},"origins":{"OidcSecurityService":"./src/services/oidc.security.service","OidcSecurityValidation":"./src/services/oidc.security.validation","OidcSecurityCheckSession":"./src/services/oidc.security.check-session","OidcSecuritySilentRenew":"./src/services/oidc.security.silent-renew","OidcSecurityUserService":"./src/services/oidc.security.user-service","OidcSecurityCommon":"./src/services/oidc.security.common","OidcSecurityStorage":"./src/services/oidc.security.storage","BrowserStorage":"./src/services/oidc.security.storage","AuthWellKnownEndpoints":"./src/services/auth.well-known-endpoints","AuthConfiguration":"./src/modules/auth.configuration","OpenIDImplicitFlowConfiguration":"./src/modules/auth.configuration","DefaultConfiguration":"./src/modules/auth.configuration","AuthModule":"./src/modules/auth.module","AuthorizationResult":"./src/services/authorization-result.enum"},"importAs":"angular-auth-oidc-client"}
{
"name": "angular-auth-oidc-client",
"version": "1.3.19",
"version": "2.0.0",
"description": "An OpenID Connect Implicit Flow client for Angular",

@@ -5,0 +5,0 @@ "main": "./bundles/angular-auth-oidc-client.umd.js",

@@ -37,3 +37,3 @@ # angular-auth-oidc-client

``` javascript
"angular-auth-oidc-client": "1.3.19"
"angular-auth-oidc-client": "2.0.0"
```

@@ -93,3 +93,4 @@

openIDImplicitFlowConfiguration.silent_renew_offset_in_seconds = 0;
openIDImplicitFlowConfiguration.startup_route = '/home';
openIDImplicitFlowConfiguration.login_route = '/home';
openIDImplicitFlowConfiguration.logout_route = '/';
openIDImplicitFlowConfiguration.forbidden_route = '/Forbidden';

@@ -117,3 +118,3 @@ openIDImplicitFlowConfiguration.unauthorized_route = '/Unauthorized';

import { Subscription } from 'rxjs/Subscription';
import { OidcSecurityService } from './auth/services/oidc.security.service';
import { OidcSecurityService } from 'angular-auth-oidc-client';

@@ -120,0 +121,0 @@ @Component({

@@ -13,3 +13,3 @@ export declare class DefaultConfiguration {

silent_renew_offset_in_seconds: number;
startup_route: string;
post_login_route: string;
forbidden_route: string;

@@ -39,3 +39,3 @@ unauthorized_route: string;

silent_renew_offset_in_seconds: number;
startup_route: string;
post_login_route: string;
forbidden_route: string;

@@ -67,3 +67,3 @@ unauthorized_route: string;

readonly silent_renew_offset_in_seconds: number;
readonly startup_route: string;
readonly post_login_route: string;
readonly forbidden_route: string;

@@ -70,0 +70,0 @@ readonly unauthorized_route: string;

@@ -35,4 +35,4 @@ import { EventEmitter } from '@angular/core';

private _isAuthorizedValue;
private lastUserData;
private _userData;
private _userDataValue;
private oidcSecurityValidation;

@@ -42,3 +42,3 @@ private errorMessage;

private authWellKnownEndpointsLoaded;
private runTokenValidatationRunning;
private runTokenValidationRunning;
constructor(platformId: Object, http: Http, authConfiguration: AuthConfiguration, router: Router, oidcSecurityCheckSession: OidcSecurityCheckSession, oidcSecuritySilentRenew: OidcSecuritySilentRenew, oidcSecurityUserService: OidcSecurityUserService, oidcSecurityCommon: OidcSecurityCommon, authWellKnownEndpoints: AuthWellKnownEndpoints);

@@ -71,2 +71,3 @@ setupModule(openIDImplicitFlowConfiguration: OpenIDImplicitFlowConfiguration): void;

private onWellKnownEndpointsLoaded();
private onUserDataChanged();
private runGetSigningKeys();

@@ -76,3 +77,3 @@ private getSigningKeys();

private handleErrorGetSigningKeys(error);
private runTokenValidatation();
private runTokenValidation();
}

@@ -18,3 +18,2 @@ import { Http } from '@angular/http';

private getIdentityUserData;
private handleError(error);
}

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

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