UNPKG

msal

Version:
283 lines 10.4 kB
"use strict"; /* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.FramePrefix = exports.PromptState = exports.NetworkRequestType = exports.DisallowedEQParams = exports.SSOTypes = exports.WELL_KNOWN_SUFFIX = exports.AAD_INSTANCE_DISCOVERY_ENDPOINT = exports.DEFAULT_AUTHORITY = exports.ErrorCacheKeys = exports.PersistentCacheKeys = exports.TemporaryCacheKeys = exports.ResponseTypes = exports.ServerHashParamKeys = exports.SESSION_STORAGE = exports.Constants = void 0; /** * @hidden * Constants */ var Constants = /** @class */ (function () { function Constants() { } Object.defineProperty(Constants, "libraryName", { get: function () { return "Msal.js"; } // used in telemetry sdkName , enumerable: false, configurable: true }); Object.defineProperty(Constants, "claims", { get: function () { return "claims"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "clientId", { get: function () { return "clientId"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "adalIdToken", { get: function () { return "adal.idtoken"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "cachePrefix", { get: function () { return "msal"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "scopes", { get: function () { return "scopes"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "no_account", { get: function () { return "NO_ACCOUNT"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "upn", { get: function () { return "upn"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "domain_hint", { get: function () { return "domain_hint"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "prompt_select_account", { get: function () { return "&prompt=select_account"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "prompt_none", { get: function () { return "&prompt=none"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "prompt", { get: function () { return "prompt"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "response_mode_fragment", { get: function () { return "&response_mode=fragment"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "resourceDelimiter", { get: function () { return "|"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "cacheDelimiter", { get: function () { return "."; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "popUpWidth", { get: function () { return this._popUpWidth; }, set: function (width) { this._popUpWidth = width; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "popUpHeight", { get: function () { return this._popUpHeight; }, set: function (height) { this._popUpHeight = height; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "login", { get: function () { return "LOGIN"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "renewToken", { get: function () { return "RENEW_TOKEN"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "unknown", { get: function () { return "UNKNOWN"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "ADFS", { get: function () { return "adfs"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "homeAccountIdentifier", { get: function () { return "homeAccountIdentifier"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "common", { get: function () { return "common"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "openidScope", { get: function () { return "openid"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "profileScope", { get: function () { return "profile"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "oidcScopes", { get: function () { return [this.openidScope, this.profileScope]; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "interactionTypeRedirect", { get: function () { return "redirectInteraction"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "interactionTypePopup", { get: function () { return "popupInteraction"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "interactionTypeSilent", { get: function () { return "silentInteraction"; }, enumerable: false, configurable: true }); Object.defineProperty(Constants, "inProgress", { get: function () { return "inProgress"; }, enumerable: false, configurable: true }); Constants._popUpWidth = 483; Constants._popUpHeight = 600; return Constants; }()); exports.Constants = Constants; exports.SESSION_STORAGE = "sessionStorage"; /** * Keys in the hashParams */ var ServerHashParamKeys; (function (ServerHashParamKeys) { ServerHashParamKeys["SCOPE"] = "scope"; ServerHashParamKeys["STATE"] = "state"; ServerHashParamKeys["ERROR"] = "error"; ServerHashParamKeys["ERROR_DESCRIPTION"] = "error_description"; ServerHashParamKeys["ACCESS_TOKEN"] = "access_token"; ServerHashParamKeys["ID_TOKEN"] = "id_token"; ServerHashParamKeys["EXPIRES_IN"] = "expires_in"; ServerHashParamKeys["SESSION_STATE"] = "session_state"; ServerHashParamKeys["CLIENT_INFO"] = "client_info"; })(ServerHashParamKeys = exports.ServerHashParamKeys || (exports.ServerHashParamKeys = {})); /** * @hidden * @ignore * response_type from OpenIDConnect * References: https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html & https://tools.ietf.org/html/rfc6749#section-4.2.1 * */ exports.ResponseTypes = { id_token: "id_token", token: "token", id_token_token: "id_token token" }; /** * @hidden * CacheKeys for MSAL */ var TemporaryCacheKeys; (function (TemporaryCacheKeys) { TemporaryCacheKeys["AUTHORITY"] = "authority"; TemporaryCacheKeys["ACQUIRE_TOKEN_ACCOUNT"] = "acquireTokenAccount"; TemporaryCacheKeys["SESSION_STATE"] = "session.state"; TemporaryCacheKeys["STATE_LOGIN"] = "state.login"; TemporaryCacheKeys["STATE_ACQ_TOKEN"] = "state.acquireToken"; TemporaryCacheKeys["STATE_RENEW"] = "state.renew"; TemporaryCacheKeys["NONCE_IDTOKEN"] = "nonce.idtoken"; TemporaryCacheKeys["LOGIN_REQUEST"] = "login.request"; TemporaryCacheKeys["RENEW_STATUS"] = "token.renew.status"; TemporaryCacheKeys["URL_HASH"] = "urlHash"; TemporaryCacheKeys["INTERACTION_STATUS"] = "interaction.status"; TemporaryCacheKeys["REDIRECT_REQUEST"] = "redirect_request"; })(TemporaryCacheKeys = exports.TemporaryCacheKeys || (exports.TemporaryCacheKeys = {})); var PersistentCacheKeys; (function (PersistentCacheKeys) { PersistentCacheKeys["IDTOKEN"] = "idtoken"; PersistentCacheKeys["CLIENT_INFO"] = "client.info"; })(PersistentCacheKeys = exports.PersistentCacheKeys || (exports.PersistentCacheKeys = {})); var ErrorCacheKeys; (function (ErrorCacheKeys) { ErrorCacheKeys["LOGIN_ERROR"] = "login.error"; ErrorCacheKeys["ERROR"] = "error"; ErrorCacheKeys["ERROR_DESC"] = "error.description"; })(ErrorCacheKeys = exports.ErrorCacheKeys || (exports.ErrorCacheKeys = {})); exports.DEFAULT_AUTHORITY = "https://login.microsoftonline.com/common/"; exports.AAD_INSTANCE_DISCOVERY_ENDPOINT = exports.DEFAULT_AUTHORITY + "/discovery/instance?api-version=1.1&authorization_endpoint="; exports.WELL_KNOWN_SUFFIX = ".well-known/openid-configuration"; /** * @hidden * SSO Types - generated to populate hints */ var SSOTypes; (function (SSOTypes) { SSOTypes["ACCOUNT"] = "account"; SSOTypes["SID"] = "sid"; SSOTypes["LOGIN_HINT"] = "login_hint"; SSOTypes["ORGANIZATIONS"] = "organizations"; SSOTypes["CONSUMERS"] = "consumers"; SSOTypes["ID_TOKEN"] = "id_token"; SSOTypes["ACCOUNT_ID"] = "accountIdentifier"; SSOTypes["HOMEACCOUNT_ID"] = "homeAccountIdentifier"; })(SSOTypes = exports.SSOTypes || (exports.SSOTypes = {})); /** * @hidden */ exports.DisallowedEQParams = [ SSOTypes.SID, SSOTypes.LOGIN_HINT ]; exports.NetworkRequestType = { GET: "GET", POST: "POST" }; /** * we considered making this "enum" in the request instead of string, however it looks like the allowed list of * prompt values kept changing over past couple of years. There are some undocumented prompt values for some * internal partners too, hence the choice of generic "string" type instead of the "enum" * @hidden */ exports.PromptState = { LOGIN: "login", SELECT_ACCOUNT: "select_account", CONSENT: "consent", NONE: "none" }; /** * Frame name prefixes for the hidden iframe created in silent frames */ exports.FramePrefix = { ID_TOKEN_FRAME: "msalIdTokenFrame", TOKEN_FRAME: "msalRenewFrame" }; //# sourceMappingURL=Constants.js.map