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

@azure/msal-node

Package Overview
Dependencies
Maintainers
3
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/msal-node - npm Package Compare versions

Comparing version 1.0.0-alpha.15 to 1.0.0-alpha.16

15

CHANGELOG.json

@@ -5,2 +5,17 @@ {

{
"date": "Tue, 10 Nov 2020 01:48:44 GMT",
"tag": "@azure/msal-node_v1.0.0-alpha.16",
"version": "1.0.0-alpha.16",
"comments": {
"prerelease": [
{
"comment": "Enhance lookup for IdTokens/AppMetadata (#2530)",
"author": "sameera.gajjarapu@microsoft.com",
"commit": "e51446295f8c857f1abc7f6874a4c7fde157699e",
"package": "@azure/msal-node"
}
]
}
},
{
"date": "Sat, 07 Nov 2020 01:50:14 GMT",

@@ -7,0 +22,0 @@ "tag": "@azure/msal-node_v1.0.0-alpha.15",

10

changelog.md
# Change Log - @azure/msal-node
This log was last generated on Sat, 07 Nov 2020 01:50:14 GMT and should not be manually modified.
This log was last generated on Tue, 10 Nov 2020 01:48:44 GMT and should not be manually modified.
<!-- Start content -->
## 1.0.0-alpha.16
Tue, 10 Nov 2020 01:48:44 GMT
### Changes
- Enhance lookup for IdTokens/AppMetadata (#2530) (sameera.gajjarapu@microsoft.com)
## 1.0.0-alpha.15

@@ -8,0 +16,0 @@

2

dist/msal-node.cjs.production.min.js

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

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t,n=require("@azure/msal-common"),r=e(require("axios")),i=require("uuid"),o=e(require("crypto")),a=require("jsonwebtoken");function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function u(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function l(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator"))),function(e){e.GET="get",e.POST="post"}(t||(t={}));var h,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";!function(e){e[e.acquireTokenSilent=62]="acquireTokenSilent",e[e.acquireTokenByUsernamePassword=371]="acquireTokenByUsernamePassword",e[e.acquireTokenByDeviceCode=671]="acquireTokenByDeviceCode",e[e.acquireTokenByClientCredential=771]="acquireTokenByClientCredential",e[e.acquireTokenByCode=871]="acquireTokenByCode",e[e.acquireTokenByRefreshToken=872]="acquireTokenByRefreshToken"}(h||(h={}));var d=function(){function e(){r.defaults.validateStatus=function(){return!0}}var n=e.prototype;return n.sendGetRequestAsync=function(e,n){try{return Promise.resolve(r({method:t.GET,url:e,headers:n&&n.headers})).then((function(e){return{headers:e.headers,body:e.data,status:e.status}}))}catch(e){return Promise.reject(e)}},n.sendPostRequestAsync=function(e,n){try{return Promise.resolve(r({method:t.POST,url:e,data:n&&n.body||"",headers:n&&n.headers})).then((function(e){return{headers:e.headers,body:e.data,status:e.status}}))}catch(e){return Promise.reject(e)}},e}(),g={clientId:"",authority:"",clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",privateKey:""},knownAuthorities:[],cloudDiscoveryMetadata:"",clientCapabilities:[],protocolMode:n.ProtocolMode.AAD},m={},p={loggerOptions:{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:n.LogLevel.Info},networkClient:function(){function e(){}return e.getNetworkClient=function(){return new d},e}().getNetworkClient()};function y(e){var t=e.cache,n=e.system;return{auth:c({},g,{},e.auth),cache:c({},m,{},t),system:c({},p,{},n)}}var v=function(){function e(){}return e.generateGuid=function(){return i.v4()},e.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e}(),C=function(){function e(){}return e.base64Encode=function(e,t){return Buffer.from(e,t).toString("base64")},e.base64EncodeUrl=function(t,n){return e.base64Encode(t,n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.base64Decode=function(e){return Buffer.from(e,"base64").toString("utf8")},e.base64DecodeUrl=function(t){for(var n=t.replace(/-/g,"+").replace(/_/g,"/");n.length%4;)n+="=";return e.base64Decode(n)},e}(),T=function(){function e(){}var t=e.prototype;return t.generatePkceCodes=function(){try{var e=this.generateCodeVerifier(),t=this.generateCodeChallengeFromVerifier(e);return Promise.resolve({verifier:e,challenge:t})}catch(e){return Promise.reject(e)}},t.generateCodeVerifier=function(){var e=o.randomBytes(32),t=this.bufferToCVString(e);return C.base64EncodeUrl(t)},t.generateCodeChallengeFromVerifier=function(e){return C.base64EncodeUrl(this.sha256(e).toString("ascii"))},t.sha256=function(e){return o.createHash("sha256").update(e).digest()},t.bufferToCVString=function(e){for(var t=[],n=0;n<e.byteLength;n+=1)t.push(f[e[n]%f.length]);return t.join("")},e}(),k=function(){function e(){this.pkceGenerator=new T}var t=e.prototype;return t.createNewGuid=function(){return v.generateGuid()},t.base64Encode=function(e){return C.base64Encode(e)},t.base64Decode=function(e){return C.base64Decode(e)},t.generatePkceCodes=function(){return this.pkceGenerator.generatePkceCodes()},t.getPublicKeyThumbprint=function(){throw new Error("Method not implemented.")},t.signJwt=function(){throw new Error("Method not implemented.")},e}(),A=function(){function e(){}return e.deserializeJSONBlob=function(e){return n.StringUtils.isEmpty(e)?{}:JSON.parse(e)},e.deserializeAccounts=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={homeAccountId:i.home_account_id,environment:i.environment,realm:i.realm,localAccountId:i.local_account_id,username:i.username,authorityType:i.authority_type,name:i.name,clientInfo:i.client_info,lastModificationTime:i.last_modification_time,lastModificationApp:i.last_modification_app},a=new n.AccountEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeIdTokens=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm},a=new n.IdTokenEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeAccessTokens=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm,target:i.target,cachedAt:i.cached_at,expiresOn:i.expires_on,extendedExpiresOn:i.extended_expires_on,refreshOn:i.refresh_on,keyId:i.key_id,tokenType:i.token_type},a=new n.AccessTokenEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeRefreshTokens=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,familyId:i.family_id,target:i.target,realm:i.realm},a=new n.RefreshTokenEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeAppMetadata=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={clientId:i.client_id,environment:i.environment,familyId:i.family_id},a=new n.AppMetadataEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeAllCache=function(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}},e}(),b=function(){function e(){}return e.serializeJSONBlob=function(e){return JSON.stringify(e)},e.serializeAccounts=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={home_account_id:r.homeAccountId,environment:r.environment,realm:r.realm,local_account_id:r.localAccountId,username:r.username,authority_type:r.authorityType,name:r.name,client_info:r.clientInfo,last_modification_time:r.lastModificationTime,last_modification_app:r.lastModificationApp}})),t},e.serializeIdTokens=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={home_account_id:r.homeAccountId,environment:r.environment,credential_type:r.credentialType,client_id:r.clientId,secret:r.secret,realm:r.realm}})),t},e.serializeAccessTokens=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={home_account_id:r.homeAccountId,environment:r.environment,credential_type:r.credentialType,client_id:r.clientId,secret:r.secret,realm:r.realm,target:r.target,cached_at:r.cachedAt,expires_on:r.expiresOn,extended_expires_on:r.extendedExpiresOn,refresh_on:r.refreshOn,key_id:r.keyId,token_type:r.tokenType}})),t},e.serializeRefreshTokens=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={home_account_id:r.homeAccountId,environment:r.environment,credential_type:r.credentialType,client_id:r.clientId,secret:r.secret,family_id:r.familyId,target:r.target,realm:r.realm}})),t},e.serializeAppMetadata=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={client_id:r.clientId,environment:r.environment,family_id:r.familyId}})),t},e.serializeAllCache=function(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}},e}(),I=function(e){function t(t){var n;return(n=e.call(this)||this).cache={},n.changeEmitters=[],n.logger=t,n}s(t,e);var r=t.prototype;return r.registerChangeEmitter=function(e){this.changeEmitters.push(e)},r.emitChange=function(){this.changeEmitters.forEach((function(e){return e.call(null)}))},r.cacheToInMemoryCache=function(e){var t={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(var r in e)if(e[r]instanceof n.AccountEntity)t.accounts[r]=e[r];else if(e[r]instanceof n.IdTokenEntity)t.idTokens[r]=e[r];else if(e[r]instanceof n.AccessTokenEntity)t.accessTokens[r]=e[r];else if(e[r]instanceof n.RefreshTokenEntity)t.refreshTokens[r]=e[r];else{if(!(e[r]instanceof n.AppMetadataEntity))continue;t.appMetadata[r]=e[r]}return t},r.inMemoryCacheToCache=function(e){return this.getCache(),c({},e.accounts,{},e.idTokens,{},e.accessTokens,{},e.refreshTokens,{},e.appMetadata)},r.getInMemoryCache=function(){return this.logger.verbose("Getting in-memory cache"),this.cacheToInMemoryCache(this.getCache())},r.setInMemoryCache=function(e){this.logger.verbose("Setting in-memory cache");var t=this.inMemoryCacheToCache(e);this.setCache(t),this.emitChange()},r.getCache=function(){return this.logger.verbose("Getting cache key-value store"),this.cache},r.setCache=function(e){this.logger.verbose("Setting cache key value store"),this.cache=e,this.emitChange()},r.getItem=function(e){return this.logger.verbosePii("Item key: "+e),this.getCache()[e]},r.setItem=function(e,t){this.logger.verbosePii("Item key: "+e);var n=this.getCache();n[e]=t,this.setCache(n)},r.getAccount=function(e){var t=this.getItem(e);return t&&n.AccountEntity.isAccountEntity(t)?t:null},r.setAccount=function(e){var t=e.generateAccountKey();this.setItem(t,e)},r.getIdTokenCredential=function(e){var t=n.CredentialEntity.getCredentialType(e),r=this.getItem(e);return r&&t===n.CredentialType.ID_TOKEN?r:null},r.setIdTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},r.getAccessTokenCredential=function(e){var t=n.CredentialEntity.getCredentialType(e),r=this.getItem(e);return r&&t===n.CredentialType.ACCESS_TOKEN?r:null},r.setAccessTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},r.getRefreshTokenCredential=function(e){var t=n.CredentialEntity.getCredentialType(e),r=this.getItem(e);return r&&t===n.CredentialType.REFRESH_TOKEN?r:null},r.setRefreshTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},r.getAppMetadata=function(e){var t=this.getItem(e);return t&&n.AppMetadataEntity.isAppMetadataEntity(e,t)?t:null},r.setAppMetadata=function(e){var t=e.generateAppMetadataKey();this.setItem(t,e)},r.getServerTelemetry=function(e){var t=this.getItem(e);return t&&n.ServerTelemetryEntity.isServerTelemetryEntity(e,t)?t:null},r.setServerTelemetry=function(e,t){this.setItem(e,t)},r.getThrottlingCache=function(e){var t=this.getItem(e);return t&&n.ThrottlingEntity.isThrottlingEntity(e,t)?t:null},r.setThrottlingCache=function(e,t){this.setItem(e,t)},r.removeItem=function(e){this.logger.verbosePii("Item key: "+e);var t=!1,n=this.getCache();return n[e]&&(delete n[e],t=!0),t&&(this.setCache(n),this.emitChange()),t},r.containsKey=function(e){return this.getKeys().includes(e)},r.getKeys=function(){this.logger.verbose("Retrieving all cache keys");var e=this.getCache();return[].concat(Object.keys(e))},r.clear=function(){var e=this;this.logger.verbose("Clearing cache entries created by MSAL"),this.getKeys().forEach((function(t){e.removeItem(t)})),this.emitChange()},t.generateInMemoryCache=function(e){return A.deserializeAllCache(A.deserializeJSONBlob(e))},t.generateJsonCache=function(e){return b.serializeAllCache(e)},t}(n.CacheManager),E={},P={},O={},w={},S={},_=function(){function e(e,t,n){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),n&&(this.persistence=n),this.logger=t}var t=e.prototype;return t.hasChanged=function(){return this.cacheHasChanged},t.serialize=function(){this.logger.verbose("Serializing in-memory cache");var e=b.serializeAllCache(this.storage.getInMemoryCache());return n.StringUtils.isEmpty(this.cacheSnapshot)?this.logger.verbose("No cache snapshot to merge"):(this.logger.verbose("Reading cache snapshot from disk"),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)),this.cacheHasChanged=!1,JSON.stringify(e)},t.deserialize=function(e){if(this.logger.verbose("Deserializing JSON to in-memory cache"),this.cacheSnapshot=e,n.StringUtils.isEmpty(this.cacheSnapshot))this.logger.verbose("No cache snapshot to deserialize");else{this.logger.verbose("Reading cache snapshot from disk");var t=A.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(t)}},t.getAllAccounts=function(){try{var e,t=this;return t.logger.verbose("getAllAccounts called"),Promise.resolve(l((function(){function r(){return t.storage.getAllAccounts()}var i=function(){if(t.persistence)return e=new n.TokenCacheContext(t,!1),Promise.resolve(t.persistence.beforeCacheAccess(e)).then((function(){}))}();return i&&i.then?i.then(r):r()}),(function(n,r){function i(){if(n)throw r;return r}var o=function(){if(t.persistence&&e)return Promise.resolve(t.persistence.afterCacheAccess(e)).then((function(){}))}();return o&&o.then?o.then(i):i()})))}catch(e){return Promise.reject(e)}},t.getAccountByHomeId=function(e){try{return Promise.resolve(this.getAllAccounts()).then((function(t){return!n.StringUtils.isEmpty(e)&&t&&t.length&&t.filter((function(t){return t.homeAccountId===e}))[0]||null}))}catch(e){return Promise.reject(e)}},t.getAccountByLocalId=function(e){try{return Promise.resolve(this.getAllAccounts()).then((function(t){return!n.StringUtils.isEmpty(e)&&t&&t.length&&t.filter((function(t){return t.localAccountId===e}))[0]||null}))}catch(e){return Promise.reject(e)}},t.removeAccount=function(e){try{var t,r=this;r.logger.verbose("removeAccount called");var i=l((function(){function i(){r.storage.removeAccount(n.AccountEntity.generateAccountCacheKey(e))}var o=function(){if(r.persistence)return t=new n.TokenCacheContext(r,!0),Promise.resolve(r.persistence.beforeCacheAccess(t)).then((function(){}))}();return o&&o.then?o.then(i):i()}),(function(e,n){function i(){if(e)throw n;return n}var o=function(){if(r.persistence&&t)return Promise.resolve(r.persistence.afterCacheAccess(t)).then((function(){}))}();return o&&o.then?o.then(i):i()}));return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(e){return Promise.reject(e)}},t.handleChangeEvent=function(){this.cacheHasChanged=!0},t.mergeState=function(e,t){this.logger.verbose("Merging in-memory cache with cache snapshot");var n=this.mergeRemovals(e,t);return this.mergeUpdates(n,t)},t.mergeUpdates=function(e,t){var n=this;return Object.keys(t).forEach((function(r){var i=t[r];if(e.hasOwnProperty(r)){var o=null!==i,a="object"==typeof i,c=!Array.isArray(i);o&&a&&c&&null!=e[r]?n.mergeUpdates(e[r],i):e[r]=i}else null!==i&&(e[r]=i)})),e},t.mergeRemovals=function(e,t){return this.logger.verbose("Remove updated entries in cache"),c({},e,{Account:null!=e.Account?this.mergeRemovalsDict(e.Account,t.Account):e.Account,AccessToken:null!=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,t.AccessToken):e.AccessToken,RefreshToken:null!=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,t.RefreshToken):e.RefreshToken,IdToken:null!=e.IdToken?this.mergeRemovalsDict(e.IdToken,t.IdToken):e.IdToken,AppMetadata:null!=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,t.AppMetadata):e.AppMetadata})},t.mergeRemovalsDict=function(e,t){var n=c({},e);return Object.keys(e).forEach((function(e){t&&t.hasOwnProperty(e)||delete n[e]})),n},t.overlayDefaults=function(e){return this.logger.verbose("Overlaying input cache with the default cache"),{Account:c({},E,{},e.Account),IdToken:c({},P,{},e.IdToken),AccessToken:c({},O,{},e.AccessToken),RefreshToken:c({},w,{},e.RefreshToken),AppMetadata:c({},S,{},e.AppMetadata)}},e}(),M=function(){function e(e){this.config=y(e),this.logger=new n.Logger(this.config.system.loggerOptions),this.storage=new I(this.logger),this.tokenCache=new _(this.storage,this.logger,this.config.cache.cachePlugin),this.cryptoProvider=new k,n.TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.knownAuthorities,this.config.auth.cloudDiscoveryMetadata)}var t,r=e.prototype;return r.getAuthCodeUrl=function(e){try{var t=this;return t.logger.info("getAuthCodeUrl called"),Promise.resolve(t.buildOauthClientConfiguration(e.authority)).then((function(r){return t.logger.verbose("Auth client config generated"),new n.AuthorizationCodeClient(r).getAuthCodeUrl(t.initializeRequest(e))}))}catch(e){return Promise.reject(e)}},r.acquireTokenByCode=function(e){try{var t=this;t.logger.info("acquireTokenByCode called");var r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenByCode,r.correlationId);return Promise.resolve(u((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new n.AuthorizationCodeClient(e).acquireToken(r)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},r.acquireTokenByRefreshToken=function(e){try{var t=this;t.logger.info("acquireTokenByRefreshToken called");var r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenByRefreshToken,r.correlationId);return Promise.resolve(u((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new n.RefreshTokenClient(e).acquireToken(r)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},r.acquireTokenSilent=function(e){try{var t=this,r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenSilent,r.correlationId,r.forceRefresh);return Promise.resolve(u((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return new n.SilentFlowClient(e).acquireToken(r)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},r.getTokenCache=function(){return this.logger.info("getTokenCache called"),this.tokenCache},r.getLogger=function(){return this.logger},r.setLogger=function(e){this.logger=e},r.buildOauthClientConfiguration=function(e,t){try{var n=this;n.logger.verbose("buildOauthClientConfiguration called");var r=n.config.auth.clientId;return Promise.resolve(n.createAuthority(e)).then((function(e){return{authOptions:{clientId:r,authority:e,knownAuthorities:n.config.auth.knownAuthorities,cloudDiscoveryMetadata:n.config.auth.cloudDiscoveryMetadata,clientCapabilities:n.config.auth.clientCapabilities,protocolMode:n.config.auth.protocolMode},loggerOptions:{loggerCallback:n.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:n.config.system.loggerOptions.piiLoggingEnabled},cryptoInterface:n.cryptoProvider,networkInterface:n.config.system.networkClient,storageInterface:n.storage,serverTelemetryManager:t,clientCredentials:{clientSecret:n.clientSecret,clientAssertion:n.clientAssertion?n.getClientAssertion():void 0},libraryInfo:{sku:"msal.js.node",version:"1.0.0-alpha.15",cpu:process.arch||"",os:process.platform||""},persistencePlugin:n.config.cache.cachePlugin,serializableCache:n.tokenCache}}))}catch(e){return Promise.reject(e)}},r.getClientAssertion=function(){return{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,this._authority.tokenEndpoint),assertionType:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},r.initializeRequest=function(e){return this.logger.verbose("initializeRequestScopes called"),c({},e,{scopes:[].concat(e&&e.scopes||[],[n.Constants.OPENID_SCOPE,n.Constants.PROFILE_SCOPE,n.Constants.OFFLINE_ACCESS_SCOPE]),correlationId:e&&e.correlationId||this.cryptoProvider.createNewGuid()})},r.initializeServerTelemetryManager=function(e,t,r){return new n.ServerTelemetryManager({clientId:this.config.auth.clientId,correlationId:t,apiId:e,forceRefresh:r||!1},this.storage)},r.createAuthority=function(e){try{var t;return this.logger.verbose("createAuthority called"),e?(this.logger.verbose("Authority passed in, creating authority instance"),t=n.AuthorityFactory.createInstance(e,this.config.system.networkClient,this.config.auth.protocolMode)):(this.logger.verbose("No authority passed in request, defaulting to authority set on application object"),t=this.authority),t.discoveryComplete()?Promise.resolve(t):Promise.resolve(u((function(){return Promise.resolve(t.resolveEndpointsAsync()).then((function(){return t}))}),(function(e){throw n.ClientAuthError.createEndpointDiscoveryIncompleteError(e)})))}catch(e){return Promise.reject(e)}},(t=[{key:"authority",get:function(){return this._authority||(this._authority=n.AuthorityFactory.createInstance(this.config.auth.authority||n.Constants.DEFAULT_AUTHORITY,this.config.system.networkClient,this.config.auth.protocolMode)),this._authority}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}(),j=function(e){function t(t){return e.call(this,t)||this}s(t,e);var r=t.prototype;return r.acquireTokenByDeviceCode=function(e){try{var t=this;t.logger.info("acquireTokenByDeviceCode called");var r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenByDeviceCode,r.correlationId);return Promise.resolve(u((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new n.DeviceCodeClient(e).acquireToken(r)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},r.acquireTokenByUsernamePassword=function(e){try{var t=this;t.logger.info("acquireTokenByUsernamePassword called");var r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenByUsernamePassword,r.correlationId);return Promise.resolve(u((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new n.UsernamePasswordClient(e).acquireToken(r)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},t}(M),R=function(){function e(){}e.fromAssertion=function(t){var n=new e;return n.jwt=t,n},e.fromCertificate=function(t,n){var r=new e;return r.privateKey=n,r.thumbprint=t,r};var t=e.prototype;return t.getJwt=function(e,t,r){if(null!=this.privateKey&&null!=this.thumbprint)return null==this.jwt||this.isExpired()||t!=this.issuer||r!=this.jwtAudience?this.createJwt(e,t,r):this.jwt;if(null!=this.jwt)return this.jwt;throw n.ClientAuthError.createInvalidAssertionError()},t.createJwt=function(e,t,r){var i,o;this.issuer=t,this.jwtAudience=r;var c=n.TimeUtils.nowSeconds();this.expirationTime=c+600;var s=((i={}).alg="RS256",i.x5t=C.base64EncodeUrl(this.thumbprint,"hex"),i),u=((o={}).aud=this.jwtAudience,o.exp=this.expirationTime,o.iss=this.issuer,o.sub=this.issuer,o.nbf=c,o.jti=e.createNewGuid(),o);return this.jwt=a.sign(u,this.privateKey,{header:s}),this.jwt},t.isExpired=function(){return this.expirationTime<n.TimeUtils.nowSeconds()},e}(),q=function(e){function t(t){var n;return(n=e.call(this,t)||this).setClientCredential(n.config),n}s(t,e);var r=t.prototype;return r.acquireTokenByClientCredential=function(e){try{var t=this;t.logger.info("acquireTokenByClientCredential called");var r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenByClientCredential,r.correlationId,r.skipCache);return Promise.resolve(u((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(r){return t.logger.verbose("Auth client config generated"),new n.ClientCredentialClient(r).acquireToken(e)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},r.acquireTokenOnBehalfOf=function(e){try{var t=this;return t.logger.info("acquireTokenOnBehalfOf called"),Promise.resolve(t.buildOauthClientConfiguration(e.authority)).then((function(r){return t.logger.verbose("Auth client config generated"),new n.OnBehalfOfClient(r).acquireToken(t.initializeRequest(e))}))}catch(e){return Promise.reject(e)}},r.setClientCredential=function(e){var t=!n.StringUtils.isEmpty(e.auth.clientSecret),r=!n.StringUtils.isEmpty(e.auth.clientAssertion),i=e.auth.clientCertificate,o=!n.StringUtils.isEmpty(i.thumbprint)||!n.StringUtils.isEmpty(i.privateKey);if(t&&r||r&&o||t&&o)throw n.ClientAuthError.createInvalidCredentialError();if(t)this.clientSecret=e.auth.clientSecret;else if(r)this.clientAssertion=R.fromAssertion(e.auth.clientAssertion);else{if(!o)throw n.ClientAuthError.createInvalidCredentialError();this.clientAssertion=R.fromCertificate(i.thumbprint,i.privateKey)}},t}(M);Object.defineProperty(exports,"AuthError",{enumerable:!0,get:function(){return n.AuthError}}),Object.defineProperty(exports,"AuthErrorMessage",{enumerable:!0,get:function(){return n.AuthErrorMessage}}),Object.defineProperty(exports,"ClientAuthError",{enumerable:!0,get:function(){return n.ClientAuthError}}),Object.defineProperty(exports,"ClientAuthErrorMessage",{enumerable:!0,get:function(){return n.ClientAuthErrorMessage}}),Object.defineProperty(exports,"ClientConfigurationError",{enumerable:!0,get:function(){return n.ClientConfigurationError}}),Object.defineProperty(exports,"ClientConfigurationErrorMessage",{enumerable:!0,get:function(){return n.ClientConfigurationErrorMessage}}),Object.defineProperty(exports,"InteractionRequiredAuthError",{enumerable:!0,get:function(){return n.InteractionRequiredAuthError}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return n.LogLevel}}),Object.defineProperty(exports,"Logger",{enumerable:!0,get:function(){return n.Logger}}),Object.defineProperty(exports,"PromptValue",{enumerable:!0,get:function(){return n.PromptValue}}),Object.defineProperty(exports,"ProtocolMode",{enumerable:!0,get:function(){return n.ProtocolMode}}),Object.defineProperty(exports,"ResponseMode",{enumerable:!0,get:function(){return n.ResponseMode}}),Object.defineProperty(exports,"ServerError",{enumerable:!0,get:function(){return n.ServerError}}),Object.defineProperty(exports,"TokenCacheContext",{enumerable:!0,get:function(){return n.TokenCacheContext}}),exports.ConfidentialClientApplication=q,exports.CryptoProvider=k,exports.Deserializer=A,exports.PublicClientApplication=j,exports.Serializer=b,exports.Storage=I,exports.TokenCache=_,exports.buildAppConfiguration=y;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@azure/msal-common"),r=e(require("axios")),n=require("uuid"),i=e(require("crypto")),o=require("jsonwebtoken");function a(e,t,r,n,i,o,a){try{var c=e[o](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,i)}function c(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function c(e){a(o,n,i,c,s,"next",e)}function s(e){a(o,n,i,c,s,"throw",e)}c(void 0)}))}}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var h,l,f=(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=Object.create((t&&t.prototype instanceof l?t:l).prototype),o=new A(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var c=C(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(e,r,o),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};d[i]=function(){return this};var g=Object.getPrototypeOf,y=g&&g(g(w([])));y&&y!==t&&r.call(y,i)&&(d=y);var v=p.prototype=l.prototype=Object.create(d);function m(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){var n;this._invoke=function(i,o){function a(){return new t((function(n,a){!function n(i,o,a,c){var s=u(e[i],e,o);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(l).then((function(e){h.value=e,a(h)}),(function(e){return n("throw",e,a,c)}))}c(s.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function C(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,C(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function w(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=v.constructor=p,p.constructor=f,f.displayName=c(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},m(k.prototype),k.prototype[o]=function(){return this},e.AsyncIterator=k,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new k(s(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(v),c(v,a,"Generator"),v[i]=function(){return this},v.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=w,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:w(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(l={exports:{}}),l.exports);!function(e){e.GET="get",e.POST="post"}(h||(h={}));var p,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";!function(e){e[e.acquireTokenSilent=62]="acquireTokenSilent",e[e.acquireTokenByUsernamePassword=371]="acquireTokenByUsernamePassword",e[e.acquireTokenByDeviceCode=671]="acquireTokenByDeviceCode",e[e.acquireTokenByClientCredential=771]="acquireTokenByClientCredential",e[e.acquireTokenByCode=871]="acquireTokenByCode",e[e.acquireTokenByRefreshToken=872]="acquireTokenByRefreshToken"}(p||(p={}));var g=function(){function e(){r.defaults.validateStatus=function(){return!0}}var t=e.prototype;return t.sendGetRequestAsync=function(){var e=c(f.mark((function e(t,n){var i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={method:h.GET,url:t,headers:n&&n.headers},e.next=3,r(i);case 3:return e.abrupt("return",{headers:(o=e.sent).headers,body:o.data,status:o.status});case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),t.sendPostRequestAsync=function(){var e=c(f.mark((function e(t,n){var i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={method:h.POST,url:t,data:n&&n.body||"",headers:n&&n.headers},e.next=3,r(i);case 3:return e.abrupt("return",{headers:(o=e.sent).headers,body:o.data,status:o.status});case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),e}(),y={clientId:"",authority:"",clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",privateKey:""},knownAuthorities:[],cloudDiscoveryMetadata:"",clientCapabilities:[],protocolMode:t.ProtocolMode.AAD},v={},m={loggerOptions:{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:t.LogLevel.Info},networkClient:function(){function e(){}return e.getNetworkClient=function(){return new g},e}().getNetworkClient()};function k(e){var t=e.cache,r=e.system;return{auth:s({},y,e.auth),cache:s({},v,t),system:s({},m,r)}}var C=function(){function e(){}return e.generateGuid=function(){return n.v4()},e.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e}(),b=function(){function e(){}return e.base64Encode=function(e,t){return Buffer.from(e,t).toString("base64")},e.base64EncodeUrl=function(t,r){return e.base64Encode(t,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.base64Decode=function(e){return Buffer.from(e,"base64").toString("utf8")},e.base64DecodeUrl=function(t){for(var r=t.replace(/-/g,"+").replace(/_/g,"/");r.length%4;)r+="=";return e.base64Decode(r)},e}(),T=function(){function e(){}var t=e.prototype;return t.generatePkceCodes=function(){var e=c(f.mark((function e(){var t,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(t),e.abrupt("return",{verifier:t,challenge:r});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.generateCodeVerifier=function(){var e=i.randomBytes(32),t=this.bufferToCVString(e);return b.base64EncodeUrl(t)},t.generateCodeChallengeFromVerifier=function(e){return b.base64EncodeUrl(this.sha256(e).toString("ascii"))},t.sha256=function(e){return i.createHash("sha256").update(e).digest()},t.bufferToCVString=function(e){for(var t=[],r=0;r<e.byteLength;r+=1)t.push(d[e[r]%d.length]);return t.join("")},e}(),A=function(){function e(){this.pkceGenerator=new T}var t=e.prototype;return t.createNewGuid=function(){return C.generateGuid()},t.base64Encode=function(e){return b.base64Encode(e)},t.base64Decode=function(e){return b.base64Decode(e)},t.generatePkceCodes=function(){return this.pkceGenerator.generatePkceCodes()},t.getPublicKeyThumbprint=function(){throw new Error("Method not implemented.")},t.signJwt=function(){throw new Error("Method not implemented.")},e}(),w=function(){function e(){}return e.deserializeJSONBlob=function(e){return t.StringUtils.isEmpty(e)?{}:JSON.parse(e)},e.deserializeAccounts=function(e){var r={};return e&&Object.keys(e).map((function(n){var i=e[n],o={homeAccountId:i.home_account_id,environment:i.environment,realm:i.realm,localAccountId:i.local_account_id,username:i.username,authorityType:i.authority_type,name:i.name,clientInfo:i.client_info,lastModificationTime:i.last_modification_time,lastModificationApp:i.last_modification_app},a=new t.AccountEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeIdTokens=function(e){var r={};return e&&Object.keys(e).map((function(n){var i=e[n],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm},a=new t.IdTokenEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeAccessTokens=function(e){var r={};return e&&Object.keys(e).map((function(n){var i=e[n],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm,target:i.target,cachedAt:i.cached_at,expiresOn:i.expires_on,extendedExpiresOn:i.extended_expires_on,refreshOn:i.refresh_on,keyId:i.key_id,tokenType:i.token_type},a=new t.AccessTokenEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeRefreshTokens=function(e){var r={};return e&&Object.keys(e).map((function(n){var i=e[n],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,familyId:i.family_id,target:i.target,realm:i.realm},a=new t.RefreshTokenEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeAppMetadata=function(e){var r={};return e&&Object.keys(e).map((function(n){var i=e[n],o={clientId:i.client_id,environment:i.environment,familyId:i.family_id},a=new t.AppMetadataEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeAllCache=function(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}},e}(),E=function(){function e(){}return e.serializeJSONBlob=function(e){return JSON.stringify(e)},e.serializeAccounts=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={home_account_id:n.homeAccountId,environment:n.environment,realm:n.realm,local_account_id:n.localAccountId,username:n.username,authority_type:n.authorityType,name:n.name,client_info:n.clientInfo,last_modification_time:n.lastModificationTime,last_modification_app:n.lastModificationApp}})),t},e.serializeIdTokens=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={home_account_id:n.homeAccountId,environment:n.environment,credential_type:n.credentialType,client_id:n.clientId,secret:n.secret,realm:n.realm}})),t},e.serializeAccessTokens=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={home_account_id:n.homeAccountId,environment:n.environment,credential_type:n.credentialType,client_id:n.clientId,secret:n.secret,realm:n.realm,target:n.target,cached_at:n.cachedAt,expires_on:n.expiresOn,extended_expires_on:n.extendedExpiresOn,refresh_on:n.refreshOn,key_id:n.keyId,token_type:n.tokenType}})),t},e.serializeRefreshTokens=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={home_account_id:n.homeAccountId,environment:n.environment,credential_type:n.credentialType,client_id:n.clientId,secret:n.secret,family_id:n.familyId,target:n.target,realm:n.realm}})),t},e.serializeAppMetadata=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={client_id:n.clientId,environment:n.environment,family_id:n.familyId}})),t},e.serializeAllCache=function(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}},e}(),x=function(e){function r(t){var r;return(r=e.call(this)||this).cache={},r.changeEmitters=[],r.logger=t,r}u(r,e);var n=r.prototype;return n.registerChangeEmitter=function(e){this.changeEmitters.push(e)},n.emitChange=function(){this.changeEmitters.forEach((function(e){return e.call(null)}))},n.cacheToInMemoryCache=function(e){var r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(var n in e)if(e[n]instanceof t.AccountEntity)r.accounts[n]=e[n];else if(e[n]instanceof t.IdTokenEntity)r.idTokens[n]=e[n];else if(e[n]instanceof t.AccessTokenEntity)r.accessTokens[n]=e[n];else if(e[n]instanceof t.RefreshTokenEntity)r.refreshTokens[n]=e[n];else{if(!(e[n]instanceof t.AppMetadataEntity))continue;r.appMetadata[n]=e[n]}return r},n.inMemoryCacheToCache=function(e){return this.getCache(),s({},e.accounts,e.idTokens,e.accessTokens,e.refreshTokens,e.appMetadata)},n.getInMemoryCache=function(){return this.logger.verbose("Getting in-memory cache"),this.cacheToInMemoryCache(this.getCache())},n.setInMemoryCache=function(e){this.logger.verbose("Setting in-memory cache");var t=this.inMemoryCacheToCache(e);this.setCache(t),this.emitChange()},n.getCache=function(){return this.logger.verbose("Getting cache key-value store"),this.cache},n.setCache=function(e){this.logger.verbose("Setting cache key value store"),this.cache=e,this.emitChange()},n.getItem=function(e){return this.logger.verbosePii("Item key: "+e),this.getCache()[e]},n.setItem=function(e,t){this.logger.verbosePii("Item key: "+e);var r=this.getCache();r[e]=t,this.setCache(r)},n.getAccount=function(e){var r=this.getItem(e);return t.AccountEntity.isAccountEntity(r)?r:null},n.setAccount=function(e){var t=e.generateAccountKey();this.setItem(t,e)},n.getIdTokenCredential=function(e){var r=this.getItem(e);return t.IdTokenEntity.isIdTokenEntity(r)?r:null},n.setIdTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},n.getAccessTokenCredential=function(e){var r=this.getItem(e);return t.AccessTokenEntity.isAccessTokenEntity(r)?r:null},n.setAccessTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},n.getRefreshTokenCredential=function(e){var r=this.getItem(e);return t.RefreshTokenEntity.isRefreshTokenEntity(r)?r:null},n.setRefreshTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},n.getAppMetadata=function(e){var r=this.getItem(e);return t.AppMetadataEntity.isAppMetadataEntity(e,r)?r:null},n.setAppMetadata=function(e){var t=e.generateAppMetadataKey();this.setItem(t,e)},n.getServerTelemetry=function(e){var r=this.getItem(e);return r&&t.ServerTelemetryEntity.isServerTelemetryEntity(e,r)?r:null},n.setServerTelemetry=function(e,t){this.setItem(e,t)},n.getThrottlingCache=function(e){var r=this.getItem(e);return r&&t.ThrottlingEntity.isThrottlingEntity(e,r)?r:null},n.setThrottlingCache=function(e,t){this.setItem(e,t)},n.removeItem=function(e){this.logger.verbosePii("Item key: "+e);var t=!1,r=this.getCache();return r[e]&&(delete r[e],t=!0),t&&(this.setCache(r),this.emitChange()),t},n.containsKey=function(e){return this.getKeys().includes(e)},n.getKeys=function(){this.logger.verbose("Retrieving all cache keys");var e=this.getCache();return[].concat(Object.keys(e))},n.clear=function(){var e=this;this.logger.verbose("Clearing cache entries created by MSAL"),this.getKeys().forEach((function(t){e.removeItem(t)})),this.emitChange()},r.generateInMemoryCache=function(e){return w.deserializeAllCache(w.deserializeJSONBlob(e))},r.generateJsonCache=function(e){return E.serializeAllCache(e)},r}(t.CacheManager),I={},O={},_={},S={},M={},R=function(){function e(e,t,r){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),r&&(this.persistence=r),this.logger=t}var r=e.prototype;return r.hasChanged=function(){return this.cacheHasChanged},r.serialize=function(){this.logger.verbose("Serializing in-memory cache");var e=E.serializeAllCache(this.storage.getInMemoryCache());return t.StringUtils.isEmpty(this.cacheSnapshot)?this.logger.verbose("No cache snapshot to merge"):(this.logger.verbose("Reading cache snapshot from disk"),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)),this.cacheHasChanged=!1,JSON.stringify(e)},r.deserialize=function(e){if(this.logger.verbose("Deserializing JSON to in-memory cache"),this.cacheSnapshot=e,t.StringUtils.isEmpty(this.cacheSnapshot))this.logger.verbose("No cache snapshot to deserialize");else{this.logger.verbose("Reading cache snapshot from disk");var r=w.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}},r.getAllAccounts=function(){var e=c(f.mark((function e(){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.verbose("getAllAccounts called"),e.prev=1,!this.persistence){e.next=6;break}return r=new t.TokenCacheContext(this,!1),e.next=6,this.persistence.beforeCacheAccess(r);case 6:return e.abrupt("return",this.storage.getAllAccounts());case 7:if(e.prev=7,!this.persistence||!r){e.next=11;break}return e.next=11,this.persistence.afterCacheAccess(r);case 11:return e.finish(7);case 12:case"end":return e.stop()}}),e,this,[[1,,7,12]])})));return function(){return e.apply(this,arguments)}}(),r.getAccountByHomeId=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllAccounts();case 2:if(n=e.sent,t.StringUtils.isEmpty(r)||!n||!n.length){e.next=7;break}return e.abrupt("return",n.filter((function(e){return e.homeAccountId===r}))[0]||null);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.getAccountByLocalId=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllAccounts();case 2:if(n=e.sent,t.StringUtils.isEmpty(r)||!n||!n.length){e.next=7;break}return e.abrupt("return",n.filter((function(e){return e.localAccountId===r}))[0]||null);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.removeAccount=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.verbose("removeAccount called"),e.prev=1,!this.persistence){e.next=6;break}return n=new t.TokenCacheContext(this,!0),e.next=6,this.persistence.beforeCacheAccess(n);case 6:this.storage.removeAccount(t.AccountEntity.generateAccountCacheKey(r));case 7:if(e.prev=7,!this.persistence||!n){e.next=11;break}return e.next=11,this.persistence.afterCacheAccess(n);case 11:return e.finish(7);case 12:case"end":return e.stop()}}),e,this,[[1,,7,12]])})));return function(t){return e.apply(this,arguments)}}(),r.handleChangeEvent=function(){this.cacheHasChanged=!0},r.mergeState=function(e,t){this.logger.verbose("Merging in-memory cache with cache snapshot");var r=this.mergeRemovals(e,t);return this.mergeUpdates(r,t)},r.mergeUpdates=function(e,t){var r=this;return Object.keys(t).forEach((function(n){var i=t[n];if(e.hasOwnProperty(n)){var o=null!==i,a="object"==typeof i,c=!Array.isArray(i);o&&a&&c&&null!=e[n]?r.mergeUpdates(e[n],i):e[n]=i}else null!==i&&(e[n]=i)})),e},r.mergeRemovals=function(e,t){return this.logger.verbose("Remove updated entries in cache"),s({},e,{Account:null!=e.Account?this.mergeRemovalsDict(e.Account,t.Account):e.Account,AccessToken:null!=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,t.AccessToken):e.AccessToken,RefreshToken:null!=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,t.RefreshToken):e.RefreshToken,IdToken:null!=e.IdToken?this.mergeRemovalsDict(e.IdToken,t.IdToken):e.IdToken,AppMetadata:null!=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,t.AppMetadata):e.AppMetadata})},r.mergeRemovalsDict=function(e,t){var r=s({},e);return Object.keys(e).forEach((function(e){t&&t.hasOwnProperty(e)||delete r[e]})),r},r.overlayDefaults=function(e){return this.logger.verbose("Overlaying input cache with the default cache"),{Account:s({},I,e.Account),IdToken:s({},O,e.IdToken),AccessToken:s({},_,e.AccessToken),RefreshToken:s({},S,e.RefreshToken),AppMetadata:s({},M,e.AppMetadata)}},e}(),j=function(){function e(e){this.config=k(e),this.logger=new t.Logger(this.config.system.loggerOptions),this.storage=new x(this.logger),this.tokenCache=new R(this.storage,this.logger,this.config.cache.cachePlugin),this.cryptoProvider=new A,t.TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.knownAuthorities,this.config.auth.cloudDiscoveryMetadata)}var r,n=e.prototype;return n.getAuthCodeUrl=function(){var e=c(f.mark((function e(r){var n,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("getAuthCodeUrl called"),e.next=3,this.buildOauthClientConfiguration(r.authority);case 3:return n=e.sent,this.logger.verbose("Auth client config generated"),i=new t.AuthorizationCodeClient(n),e.abrupt("return",i.getAuthCodeUrl(this.initializeRequest(r)));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.acquireTokenByCode=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByCode called"),n=this.initializeRequest(r),i=this.initializeServerTelemetryManager(p.acquireTokenByCode,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(r.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.AuthorizationCodeClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),n.acquireTokenByRefreshToken=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByRefreshToken called"),n=this.initializeRequest(r),i=this.initializeServerTelemetryManager(p.acquireTokenByRefreshToken,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(r.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.RefreshTokenClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),n.acquireTokenSilent=function(){var e=c(f.mark((function e(r){var n,i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.initializeRequest(r),i=this.initializeServerTelemetryManager(p.acquireTokenSilent,n.correlationId,n.forceRefresh),e.prev=2,e.next=5,this.buildOauthClientConfiguration(r.authority,i);case 5:return o=new t.SilentFlowClient(e.sent),e.abrupt("return",o.acquireToken(n));case 10:throw e.prev=10,e.t0=e.catch(2),i.cacheFailedRequest(e.t0),e.t0;case 14:case"end":return e.stop()}}),e,this,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),n.getTokenCache=function(){return this.logger.info("getTokenCache called"),this.tokenCache},n.getLogger=function(){return this.logger},n.setLogger=function(e){this.logger=e},n.buildOauthClientConfiguration=function(){var e=c(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.verbose("buildOauthClientConfiguration called"),e.t0=this.config.auth.clientId,e.next=4,this.createAuthority(t);case 4:return e.t1=e.sent,e.t2=this.config.auth.knownAuthorities,e.t3=this.config.auth.cloudDiscoveryMetadata,e.t4=this.config.auth.clientCapabilities,e.t5=this.config.auth.protocolMode,e.t6={clientId:e.t0,authority:e.t1,knownAuthorities:e.t2,cloudDiscoveryMetadata:e.t3,clientCapabilities:e.t4,protocolMode:e.t5},e.t7={loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled},e.t8=this.cryptoProvider,e.t9=this.config.system.networkClient,e.t10=this.storage,e.t11=r,e.t12={clientSecret:this.clientSecret,clientAssertion:this.clientAssertion?this.getClientAssertion():void 0},e.t13={sku:"msal.js.node",version:"1.0.0-alpha.16",cpu:process.arch||"",os:process.platform||""},e.t14=this.config.cache.cachePlugin,e.t15=this.tokenCache,e.abrupt("return",{authOptions:e.t6,loggerOptions:e.t7,cryptoInterface:e.t8,networkInterface:e.t9,storageInterface:e.t10,serverTelemetryManager:e.t11,clientCredentials:e.t12,libraryInfo:e.t13,persistencePlugin:e.t14,serializableCache:e.t15});case 20:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),n.getClientAssertion=function(){return{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,this._authority.tokenEndpoint),assertionType:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},n.initializeRequest=function(e){return this.logger.verbose("initializeRequestScopes called"),s({},e,{scopes:[].concat(e&&e.scopes||[],[t.Constants.OPENID_SCOPE,t.Constants.PROFILE_SCOPE,t.Constants.OFFLINE_ACCESS_SCOPE]),correlationId:e&&e.correlationId||this.cryptoProvider.createNewGuid()})},n.initializeServerTelemetryManager=function(e,r,n){return new t.ServerTelemetryManager({clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:n||!1},this.storage)},n.createAuthority=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.verbose("createAuthority called"),r?(this.logger.verbose("Authority passed in, creating authority instance"),n=t.AuthorityFactory.createInstance(r,this.config.system.networkClient,this.config.auth.protocolMode)):(this.logger.verbose("No authority passed in request, defaulting to authority set on application object"),n=this.authority),!n.discoveryComplete()){e.next=4;break}return e.abrupt("return",n);case 4:return e.prev=4,e.next=7,n.resolveEndpointsAsync();case 7:return e.abrupt("return",n);case 10:throw e.prev=10,e.t0=e.catch(4),t.ClientAuthError.createEndpointDiscoveryIncompleteError(e.t0);case 13:case"end":return e.stop()}}),e,this,[[4,10]])})));return function(t){return e.apply(this,arguments)}}(),(r=[{key:"authority",get:function(){return this._authority||(this._authority=t.AuthorityFactory.createInstance(this.config.auth.authority||t.Constants.DEFAULT_AUTHORITY,this.config.system.networkClient,this.config.auth.protocolMode)),this._authority}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,r),e}(),q=function(e){function r(t){return e.call(this,t)||this}u(r,e);var n=r.prototype;return n.acquireTokenByDeviceCode=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByDeviceCode called"),n=this.initializeRequest(r),i=this.initializeServerTelemetryManager(p.acquireTokenByDeviceCode,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(r.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.DeviceCodeClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),n.acquireTokenByUsernamePassword=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByUsernamePassword called"),n=this.initializeRequest(r),i=this.initializeServerTelemetryManager(p.acquireTokenByUsernamePassword,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(r.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.UsernamePasswordClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),r}(j),P=function(){function e(){}e.fromAssertion=function(t){var r=new e;return r.jwt=t,r},e.fromCertificate=function(t,r){var n=new e;return n.privateKey=r,n.thumbprint=t,n};var r=e.prototype;return r.getJwt=function(e,r,n){if(null!=this.privateKey&&null!=this.thumbprint)return null==this.jwt||this.isExpired()||r!=this.issuer||n!=this.jwtAudience?this.createJwt(e,r,n):this.jwt;if(null!=this.jwt)return this.jwt;throw t.ClientAuthError.createInvalidAssertionError()},r.createJwt=function(e,r,n){var i,a;this.issuer=r,this.jwtAudience=n;var c=t.TimeUtils.nowSeconds();this.expirationTime=c+600;var s=((i={}).alg="RS256",i.x5t=b.base64EncodeUrl(this.thumbprint,"hex"),i),u=((a={}).aud=this.jwtAudience,a.exp=this.expirationTime,a.iss=this.issuer,a.sub=this.issuer,a.nbf=c,a.jti=e.createNewGuid(),a);return this.jwt=o.sign(u,this.privateKey,{header:s}),this.jwt},r.isExpired=function(){return this.expirationTime<t.TimeUtils.nowSeconds()},e}(),z=function(e){function r(t){var r;return(r=e.call(this,t)||this).setClientCredential(r.config),r}u(r,e);var n=r.prototype;return n.acquireTokenByClientCredential=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByClientCredential called"),n=this.initializeRequest(r),i=this.initializeServerTelemetryManager(p.acquireTokenByClientCredential,n.correlationId,n.skipCache),e.prev=3,e.next=6,this.buildOauthClientConfiguration(r.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.ClientCredentialClient(o),e.abrupt("return",a.acquireToken(r));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),n.acquireTokenOnBehalfOf=function(){var e=c(f.mark((function e(r){var n,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenOnBehalfOf called"),e.next=3,this.buildOauthClientConfiguration(r.authority);case 3:return n=e.sent,this.logger.verbose("Auth client config generated"),i=new t.OnBehalfOfClient(n),e.abrupt("return",i.acquireToken(this.initializeRequest(r)));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.setClientCredential=function(e){var r=!t.StringUtils.isEmpty(e.auth.clientSecret),n=!t.StringUtils.isEmpty(e.auth.clientAssertion),i=e.auth.clientCertificate,o=!t.StringUtils.isEmpty(i.thumbprint)||!t.StringUtils.isEmpty(i.privateKey);if(r&&n||n&&o||r&&o)throw t.ClientAuthError.createInvalidCredentialError();if(r)this.clientSecret=e.auth.clientSecret;else if(n)this.clientAssertion=P.fromAssertion(e.auth.clientAssertion);else{if(!o)throw t.ClientAuthError.createInvalidCredentialError();this.clientAssertion=P.fromCertificate(i.thumbprint,i.privateKey)}},r}(j);Object.defineProperty(exports,"AuthError",{enumerable:!0,get:function(){return t.AuthError}}),Object.defineProperty(exports,"AuthErrorMessage",{enumerable:!0,get:function(){return t.AuthErrorMessage}}),Object.defineProperty(exports,"ClientAuthError",{enumerable:!0,get:function(){return t.ClientAuthError}}),Object.defineProperty(exports,"ClientAuthErrorMessage",{enumerable:!0,get:function(){return t.ClientAuthErrorMessage}}),Object.defineProperty(exports,"ClientConfigurationError",{enumerable:!0,get:function(){return t.ClientConfigurationError}}),Object.defineProperty(exports,"ClientConfigurationErrorMessage",{enumerable:!0,get:function(){return t.ClientConfigurationErrorMessage}}),Object.defineProperty(exports,"InteractionRequiredAuthError",{enumerable:!0,get:function(){return t.InteractionRequiredAuthError}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(exports,"Logger",{enumerable:!0,get:function(){return t.Logger}}),Object.defineProperty(exports,"PromptValue",{enumerable:!0,get:function(){return t.PromptValue}}),Object.defineProperty(exports,"ProtocolMode",{enumerable:!0,get:function(){return t.ProtocolMode}}),Object.defineProperty(exports,"ResponseMode",{enumerable:!0,get:function(){return t.ResponseMode}}),Object.defineProperty(exports,"ServerError",{enumerable:!0,get:function(){return t.ServerError}}),Object.defineProperty(exports,"TokenCacheContext",{enumerable:!0,get:function(){return t.TokenCacheContext}}),exports.ConfidentialClientApplication=z,exports.CryptoProvider=A,exports.Deserializer=w,exports.PublicClientApplication=q,exports.Serializer=E,exports.Storage=x,exports.TokenCache=R,exports.buildAppConfiguration=k;
//# sourceMappingURL=msal-node.cjs.production.min.js.map
{
"name": "@azure/msal-node",
"version": "1.0.0-alpha.15",
"version": "1.0.0-alpha.16",
"author": {

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

"dependencies": {
"@azure/msal-common": "^1.7.0",
"@azure/msal-common": "^1.7.1",
"axios": "^0.19.2",

@@ -76,0 +76,0 @@ "jsonwebtoken": "^8.5.1",

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

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