Commit 3a84cbd5 authored by Ahmet Turan Koçak's avatar Ahmet Turan Koçak
Browse files

Initial commit

parents
{"version":3,"file":"CommonAuthorizationCodeRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonAuthorizationCodeRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,oBAAY,8BAA8B,GAAG,eAAe,GAAG;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,aAAa,CAAC;CACjC,CAAC"}
\ No newline at end of file
{"version":3,"file":"CommonAuthorizationUrlRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonAuthorizationUrlRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,oBAAY,6BAA6B,GAAG,eAAe,GAAG;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC"}
\ No newline at end of file
{"version":3,"file":"CommonClientCredentialRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonClientCredentialRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;;;;;GAOG;AACH,oBAAY,6BAA6B,GAAG,eAAe,GAAG;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC"}
\ No newline at end of file
{"version":3,"file":"CommonDeviceCodeRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonDeviceCodeRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,oBAAY,uBAAuB,GAAG,eAAe,GAAI;IACrD,kBAAkB,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC3D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
\ No newline at end of file
{"version":3,"file":"CommonEndSessionRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonEndSessionRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;;;GAQG;AACH,oBAAY,uBAAuB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,UAAU,CAAA;CACpC,CAAC"}
\ No newline at end of file
{"version":3,"file":"CommonOnBehalfOfRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonOnBehalfOfRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;GAMG;AACH,oBAAY,uBAAuB,GAAG,eAAe,GAAG;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
\ No newline at end of file
{"version":3,"file":"CommonRefreshTokenRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonRefreshTokenRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,oBAAY,yBAAyB,GAAG,eAAe,GAAG;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
\ No newline at end of file
{"version":3,"file":"CommonSilentFlowRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonSilentFlowRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,oBAAY,uBAAuB,GAAG,eAAe,GAAG;IACpD,OAAO,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,oBAAoB,CAAC,EAAE,UAAU,CAAC;CACrC,CAAC"}
\ No newline at end of file
{"version":3,"file":"CommonUsernamePasswordRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonUsernamePasswordRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,oBAAY,6BAA6B,GAAG,eAAe,GAAG;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC"}
\ No newline at end of file
{"version":3,"file":"RequestParameterBuilder.d.ts","sourceRoot":"","sources":["../../src/request/RequestParameterBuilder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiC,YAAY,EAAgJ,MAAM,oBAAoB,CAAC;AAG/N,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;A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,GAAG,IAAI;IAInC;;;OAGG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAOpC;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAOrC;;;OAGG;IACH,kBAAkB,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,IAAI;IAKxE;;OAEG;IACH,aAAa,IAAI,IAAI;IAIrB;;OAEG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAIvC;;OAEG;IACH,iBAAiB,IAAI,MAAM;CAS9B"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { __spreadArrays } from '../_virtual/_tslib.js';
import { AADServerParamKeys, Constants, ResponseMode, OIDC_DEFAULT_SCOPES, SSOTypes, HeaderNames, CLIENT_INFO, ClaimsRequestKeys, PasswordGrantConstants, AuthenticationScheme, ThrottlingConstants } from '../utils/Constants.js';
import { ScopeSet } from './ScopeSet.js';
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
import { RequestValidator } from './RequestValidator.js';
import { StringUtils } from '../utils/StringUtils.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var RequestParameterBuilder = /** @class */ (function () {
function RequestParameterBuilder() {
this.parameters = new Map();
}
/**
* add response_type = code
*/
RequestParameterBuilder.prototype.addResponseTypeCode = function () {
this.parameters.set(AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE));
};
/**
* add response_type = token id_token
*/
RequestParameterBuilder.prototype.addResponseTypeForTokenAndIdToken = function () {
this.parameters.set(AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.TOKEN_RESPONSE_TYPE + " " + Constants.ID_TOKEN_RESPONSE_TYPE));
};
/**
* add response_mode. defaults to query.
* @param responseMode
*/
RequestParameterBuilder.prototype.addResponseMode = function (responseMode) {
this.parameters.set(AADServerParamKeys.RESPONSE_MODE, encodeURIComponent((responseMode) ? responseMode : ResponseMode.QUERY));
};
/**
* Add flag to indicate STS should attempt to use WAM if available
*/
RequestParameterBuilder.prototype.addNativeBroker = function () {
this.parameters.set(AADServerParamKeys.NATIVE_BROKER, encodeURIComponent("1"));
};
/**
* add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios
* @param scopeSet
* @param addOidcScopes
*/
RequestParameterBuilder.prototype.addScopes = function (scopes, addOidcScopes) {
if (addOidcScopes === void 0) { addOidcScopes = true; }
var requestScopes = addOidcScopes ? __spreadArrays(scopes || [], OIDC_DEFAULT_SCOPES) : scopes || [];
var scopeSet = new ScopeSet(requestScopes);
this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));
};
/**
* add clientId
* @param clientId
*/
RequestParameterBuilder.prototype.addClientId = function (clientId) {
this.parameters.set(AADServerParamKeys.CLIENT_ID, encodeURIComponent(clientId));
};
/**
* add redirect_uri
* @param redirectUri
*/
RequestParameterBuilder.prototype.addRedirectUri = function (redirectUri) {
RequestValidator.validateRedirectUri(redirectUri);
this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));
};
/**
* add post logout redirectUri
* @param redirectUri
*/
RequestParameterBuilder.prototype.addPostLogoutRedirectUri = function (redirectUri) {
RequestValidator.validateRedirectUri(redirectUri);
this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));
};
/**
* add id_token_hint to logout request
* @param idTokenHint
*/
RequestParameterBuilder.prototype.addIdTokenHint = function (idTokenHint) {
this.parameters.set(AADServerParamKeys.ID_TOKEN_HINT, encodeURIComponent(idTokenHint));
};
/**
* add domain_hint
* @param domainHint
*/
RequestParameterBuilder.prototype.addDomainHint = function (domainHint) {
this.parameters.set(SSOTypes.DOMAIN_HINT, encodeURIComponent(domainHint));
};
/**
* add login_hint
* @param loginHint
*/
RequestParameterBuilder.prototype.addLoginHint = function (loginHint) {
this.parameters.set(SSOTypes.LOGIN_HINT, encodeURIComponent(loginHint));
};
/**
* Adds the CCS (Cache Credential Service) query parameter for login_hint
* @param loginHint
*/
RequestParameterBuilder.prototype.addCcsUpn = function (loginHint) {
this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent("UPN:" + loginHint));
};
/**
* Adds the CCS (Cache Credential Service) query parameter for account object
* @param loginHint
*/
RequestParameterBuilder.prototype.addCcsOid = function (clientInfo) {
this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent("Oid:" + clientInfo.uid + "@" + clientInfo.utid));
};
/**
* add sid
* @param sid
*/
RequestParameterBuilder.prototype.addSid = function (sid) {
this.parameters.set(SSOTypes.SID, encodeURIComponent(sid));
};
/**
* add claims
* @param claims
*/
RequestParameterBuilder.prototype.addClaims = function (claims, clientCapabilities) {
var mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);
RequestValidator.validateClaims(mergedClaims);
this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));
};
/**
* add correlationId
* @param correlationId
*/
RequestParameterBuilder.prototype.addCorrelationId = function (correlationId) {
this.parameters.set(AADServerParamKeys.CLIENT_REQUEST_ID, encodeURIComponent(correlationId));
};
/**
* add library info query params
* @param libraryInfo
*/
RequestParameterBuilder.prototype.addLibraryInfo = function (libraryInfo) {
// Telemetry Info
this.parameters.set(AADServerParamKeys.X_CLIENT_SKU, libraryInfo.sku);
this.parameters.set(AADServerParamKeys.X_CLIENT_VER, libraryInfo.version);
if (libraryInfo.os) {
this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);
}
if (libraryInfo.cpu) {
this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);
}
};
/**
* Add client telemetry parameters
* @param appTelemetry
*/
RequestParameterBuilder.prototype.addApplicationTelemetry = function (appTelemetry) {
if (appTelemetry === null || appTelemetry === void 0 ? void 0 : appTelemetry.appName) {
this.parameters.set(AADServerParamKeys.X_APP_NAME, appTelemetry.appName);
}
if (appTelemetry === null || appTelemetry === void 0 ? void 0 : appTelemetry.appVersion) {
this.parameters.set(AADServerParamKeys.X_APP_VER, appTelemetry.appVersion);
}
};
/**
* add prompt
* @param prompt
*/
RequestParameterBuilder.prototype.addPrompt = function (prompt) {
RequestValidator.validatePrompt(prompt);
this.parameters.set("" + AADServerParamKeys.PROMPT, encodeURIComponent(prompt));
};
/**
* add state
* @param state
*/
RequestParameterBuilder.prototype.addState = function (state) {
if (!StringUtils.isEmpty(state)) {
this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));
}
};
/**
* add nonce
* @param nonce
*/
RequestParameterBuilder.prototype.addNonce = function (nonce) {
this.parameters.set(AADServerParamKeys.NONCE, encodeURIComponent(nonce));
};
/**
* add code_challenge and code_challenge_method
* - throw if either of them are not passed
* @param codeChallenge
* @param codeChallengeMethod
*/
RequestParameterBuilder.prototype.addCodeChallengeParams = function (codeChallenge, codeChallengeMethod) {
RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);
if (codeChallenge && codeChallengeMethod) {
this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));
this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));
}
else {
throw ClientConfigurationError.createInvalidCodeChallengeParamsError();
}
};
/**
* add the `authorization_code` passed by the user to exchange for a token
* @param code
*/
RequestParameterBuilder.prototype.addAuthorizationCode = function (code) {
this.parameters.set(AADServerParamKeys.CODE, encodeURIComponent(code));
};
/**
* add the `authorization_code` passed by the user to exchange for a token
* @param code
*/
RequestParameterBuilder.prototype.addDeviceCode = function (code) {
this.parameters.set(AADServerParamKeys.DEVICE_CODE, encodeURIComponent(code));
};
/**
* add the `refreshToken` passed by the user
* @param refreshToken
*/
RequestParameterBuilder.prototype.addRefreshToken = function (refreshToken) {
this.parameters.set(AADServerParamKeys.REFRESH_TOKEN, encodeURIComponent(refreshToken));
};
/**
* add the `code_verifier` passed by the user to exchange for a token
* @param codeVerifier
*/
RequestParameterBuilder.prototype.addCodeVerifier = function (codeVerifier) {
this.parameters.set(AADServerParamKeys.CODE_VERIFIER, encodeURIComponent(codeVerifier));
};
/**
* add client_secret
* @param clientSecret
*/
RequestParameterBuilder.prototype.addClientSecret = function (clientSecret) {
this.parameters.set(AADServerParamKeys.CLIENT_SECRET, encodeURIComponent(clientSecret));
};
/**
* add clientAssertion for confidential client flows
* @param clientAssertion
*/
RequestParameterBuilder.prototype.addClientAssertion = function (clientAssertion) {
if (!StringUtils.isEmpty(clientAssertion)) {
this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));
}
};
/**
* add clientAssertionType for confidential client flows
* @param clientAssertionType
*/
RequestParameterBuilder.prototype.addClientAssertionType = function (clientAssertionType) {
if (!StringUtils.isEmpty(clientAssertionType)) {
this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));
}
};
/**
* add OBO assertion for confidential client flows
* @param clientAssertion
*/
RequestParameterBuilder.prototype.addOboAssertion = function (oboAssertion) {
this.parameters.set(AADServerParamKeys.OBO_ASSERTION, encodeURIComponent(oboAssertion));
};
/**
* add grant type
* @param grantType
*/
RequestParameterBuilder.prototype.addRequestTokenUse = function (tokenUse) {
this.parameters.set(AADServerParamKeys.REQUESTED_TOKEN_USE, encodeURIComponent(tokenUse));
};
/**
* add grant type
* @param grantType
*/
RequestParameterBuilder.prototype.addGrantType = function (grantType) {
this.parameters.set(AADServerParamKeys.GRANT_TYPE, encodeURIComponent(grantType));
};
/**
* add client info
*
*/
RequestParameterBuilder.prototype.addClientInfo = function () {
this.parameters.set(CLIENT_INFO, "1");
};
/**
* add extraQueryParams
* @param eQparams
*/
RequestParameterBuilder.prototype.addExtraQueryParameters = function (eQparams) {
var _this = this;
RequestValidator.sanitizeEQParams(eQparams, this.parameters);
Object.keys(eQparams).forEach(function (key) {
_this.parameters.set(key, eQparams[key]);
});
};
RequestParameterBuilder.prototype.addClientCapabilitiesToClaims = function (claims, clientCapabilities) {
var mergedClaims;
// Parse provided claims into JSON object or initialize empty object
if (!claims) {
mergedClaims = {};
}
else {
try {
mergedClaims = JSON.parse(claims);
}
catch (e) {
throw ClientConfigurationError.createInvalidClaimsRequestError();
}
}
if (clientCapabilities && clientCapabilities.length > 0) {
if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)) {
// Add access_token key to claims object
mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};
}
// Add xms_cc claim with provided clientCapabilities to access_token key
mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] = {
values: clientCapabilities
};
}
return JSON.stringify(mergedClaims);
};
/**
* adds `username` for Password Grant flow
* @param username
*/
RequestParameterBuilder.prototype.addUsername = function (username) {
this.parameters.set(PasswordGrantConstants.username, encodeURIComponent(username));
};
/**
* adds `password` for Password Grant flow
* @param password
*/
RequestParameterBuilder.prototype.addPassword = function (password) {
this.parameters.set(PasswordGrantConstants.password, encodeURIComponent(password));
};
/**
* add pop_jwk to query params
* @param cnfString
*/
RequestParameterBuilder.prototype.addPopToken = function (cnfString) {
if (!StringUtils.isEmpty(cnfString)) {
this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);
this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));
}
};
/**
* add SSH JWK and key ID to query params
*/
RequestParameterBuilder.prototype.addSshJwk = function (sshJwkString) {
if (!StringUtils.isEmpty(sshJwkString)) {
this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);
this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));
}
};
/**
* add server telemetry fields
* @param serverTelemetryManager
*/
RequestParameterBuilder.prototype.addServerTelemetry = function (serverTelemetryManager) {
this.parameters.set(AADServerParamKeys.X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());
this.parameters.set(AADServerParamKeys.X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());
};
/**
* Adds parameter that indicates to the server that throttling is supported
*/
RequestParameterBuilder.prototype.addThrottling = function () {
this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);
};
/**
* Adds logout_hint parameter for "silent" logout which prevent server account picker
*/
RequestParameterBuilder.prototype.addLogoutHint = function (logoutHint) {
this.parameters.set(AADServerParamKeys.LOGOUT_HINT, encodeURIComponent(logoutHint));
};
/**
* Utility to create a URL from the params map
*/
RequestParameterBuilder.prototype.createQueryString = function () {
var queryParameterArray = new Array();
this.parameters.forEach(function (value, key) {
queryParameterArray.push(key + "=" + value);
});
return queryParameterArray.join("&");
};
return RequestParameterBuilder;
}());
export { RequestParameterBuilder };
//# sourceMappingURL=RequestParameterBuilder.js.map
{"version":3,"file":"RequestParameterBuilder.js","sources":["../../src/request/RequestParameterBuilder.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AADServerParamKeys, Constants, ResponseMode, SSOTypes, CLIENT_INFO, AuthenticationScheme, ClaimsRequestKeys, PasswordGrantConstants, OIDC_DEFAULT_SCOPES, ThrottlingConstants, HeaderNames} from \"../utils/Constants\";\nimport { ScopeSet } from \"./ScopeSet\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { StringDict } from \"../utils/MsalTypes\";\nimport { RequestValidator } from \"./RequestValidator\";\nimport { ApplicationTelemetry, LibraryInfo } from \"../config/ClientConfiguration\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\nimport { ClientInfo } from \"../account/ClientInfo\";\n\nexport class RequestParameterBuilder {\n\n private parameters: Map<string, string>;\n\n constructor() {\n this.parameters = new Map<string, string>();\n }\n\n /**\n * add response_type = code\n */\n addResponseTypeCode(): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE)\n );\n }\n\n /**\n * add response_type = token id_token\n */\n addResponseTypeForTokenAndIdToken(): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(`${Constants.TOKEN_RESPONSE_TYPE} ${Constants.ID_TOKEN_RESPONSE_TYPE}`)\n );\n }\n\n /**\n * add response_mode. defaults to query.\n * @param responseMode\n */\n addResponseMode(responseMode?: ResponseMode): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_MODE,\n encodeURIComponent((responseMode) ? responseMode : ResponseMode.QUERY)\n );\n }\n\n /**\n * Add flag to indicate STS should attempt to use WAM if available\n */\n addNativeBroker(): void {\n this.parameters.set(\n AADServerParamKeys.NATIVE_BROKER,\n encodeURIComponent(\"1\")\n );\n }\n\n /**\n * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios\n * @param scopeSet\n * @param addOidcScopes\n */\n addScopes(scopes: string[], addOidcScopes: boolean = true): void {\n const requestScopes = addOidcScopes ? [...scopes || [], ...OIDC_DEFAULT_SCOPES] : scopes || [];\n const scopeSet = new ScopeSet(requestScopes);\n this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));\n }\n\n /**\n * add clientId\n * @param clientId\n */\n addClientId(clientId: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_ID, encodeURIComponent(clientId));\n }\n\n /**\n * add redirect_uri\n * @param redirectUri\n */\n addRedirectUri(redirectUri: string): void {\n RequestValidator.validateRedirectUri(redirectUri);\n this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));\n }\n\n /**\n * add post logout redirectUri\n * @param redirectUri\n */\n addPostLogoutRedirectUri(redirectUri: string): void {\n RequestValidator.validateRedirectUri(redirectUri);\n this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));\n }\n\n /**\n * add id_token_hint to logout request\n * @param idTokenHint\n */\n addIdTokenHint(idTokenHint: string): void {\n this.parameters.set(AADServerParamKeys.ID_TOKEN_HINT, encodeURIComponent(idTokenHint));\n }\n\n /**\n * add domain_hint\n * @param domainHint\n */\n addDomainHint(domainHint: string): void {\n this.parameters.set(SSOTypes.DOMAIN_HINT, encodeURIComponent(domainHint));\n }\n\n /**\n * add login_hint\n * @param loginHint\n */\n addLoginHint(loginHint: string): void {\n this.parameters.set(SSOTypes.LOGIN_HINT, encodeURIComponent(loginHint));\n }\n\n /**\n * Adds the CCS (Cache Credential Service) query parameter for login_hint\n * @param loginHint\n */\n addCcsUpn(loginHint: string): void {\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`UPN:${loginHint}`));\n }\n\n /**\n * Adds the CCS (Cache Credential Service) query parameter for account object\n * @param loginHint\n */\n addCcsOid(clientInfo: ClientInfo): void {\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`Oid:${clientInfo.uid}@${clientInfo.utid}`));\n }\n\n /**\n * add sid\n * @param sid\n */\n addSid(sid: string): void {\n this.parameters.set(SSOTypes.SID, encodeURIComponent(sid));\n }\n\n /**\n * add claims\n * @param claims\n */\n addClaims(claims?: string, clientCapabilities?: Array<string>): void {\n const mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);\n RequestValidator.validateClaims(mergedClaims);\n this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));\n }\n\n /**\n * add correlationId\n * @param correlationId\n */\n addCorrelationId(correlationId: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_REQUEST_ID, encodeURIComponent(correlationId));\n }\n\n /**\n * add library info query params\n * @param libraryInfo\n */\n addLibraryInfo(libraryInfo: LibraryInfo): void {\n // Telemetry Info\n this.parameters.set(AADServerParamKeys.X_CLIENT_SKU, libraryInfo.sku);\n this.parameters.set(AADServerParamKeys.X_CLIENT_VER, libraryInfo.version);\n if (libraryInfo.os) {\n this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);\n }\n if (libraryInfo.cpu) {\n this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);\n }\n }\n\n /**\n * Add client telemetry parameters\n * @param appTelemetry\n */\n addApplicationTelemetry(appTelemetry: ApplicationTelemetry): void {\n if (appTelemetry?.appName) {\n this.parameters.set(AADServerParamKeys.X_APP_NAME, appTelemetry.appName);\n }\n\n if (appTelemetry?.appVersion) {\n this.parameters.set(AADServerParamKeys.X_APP_VER, appTelemetry.appVersion);\n }\n }\n\n /**\n * add prompt\n * @param prompt\n */\n addPrompt(prompt: string): void {\n RequestValidator.validatePrompt(prompt);\n this.parameters.set(`${AADServerParamKeys.PROMPT}`, encodeURIComponent(prompt));\n }\n\n /**\n * add state\n * @param state\n */\n addState(state: string): void {\n if (!StringUtils.isEmpty(state)) {\n this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));\n }\n }\n\n /**\n * add nonce\n * @param nonce\n */\n addNonce(nonce: string): void {\n this.parameters.set(AADServerParamKeys.NONCE, encodeURIComponent(nonce));\n }\n\n /**\n * add code_challenge and code_challenge_method\n * - throw if either of them are not passed\n * @param codeChallenge\n * @param codeChallengeMethod\n */\n addCodeChallengeParams(\n codeChallenge: string,\n codeChallengeMethod: string\n ): void {\n RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);\n if (codeChallenge && codeChallengeMethod) {\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));\n } else {\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\n }\n }\n\n /**\n * add the `authorization_code` passed by the user to exchange for a token\n * @param code\n */\n addAuthorizationCode(code: string): void {\n this.parameters.set(AADServerParamKeys.CODE, encodeURIComponent(code));\n }\n\n /**\n * add the `authorization_code` passed by the user to exchange for a token\n * @param code\n */\n addDeviceCode(code: string): void {\n this.parameters.set(AADServerParamKeys.DEVICE_CODE, encodeURIComponent(code));\n }\n\n /**\n * add the `refreshToken` passed by the user\n * @param refreshToken\n */\n addRefreshToken(refreshToken: string): void {\n this.parameters.set(AADServerParamKeys.REFRESH_TOKEN, encodeURIComponent(refreshToken));\n }\n\n /**\n * add the `code_verifier` passed by the user to exchange for a token\n * @param codeVerifier\n */\n addCodeVerifier(codeVerifier: string): void {\n this.parameters.set(AADServerParamKeys.CODE_VERIFIER, encodeURIComponent(codeVerifier));\n }\n\n /**\n * add client_secret\n * @param clientSecret\n */\n addClientSecret(clientSecret: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_SECRET, encodeURIComponent(clientSecret));\n }\n\n /**\n * add clientAssertion for confidential client flows\n * @param clientAssertion\n */\n addClientAssertion(clientAssertion: string): void {\n if (!StringUtils.isEmpty(clientAssertion)) {\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));\n }\n }\n\n /**\n * add clientAssertionType for confidential client flows\n * @param clientAssertionType\n */\n addClientAssertionType(clientAssertionType: string): void {\n if (!StringUtils.isEmpty(clientAssertionType)) {\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));\n }\n }\n\n /**\n * add OBO assertion for confidential client flows\n * @param clientAssertion\n */\n addOboAssertion(oboAssertion: string): void {\n this.parameters.set(AADServerParamKeys.OBO_ASSERTION, encodeURIComponent(oboAssertion));\n }\n\n /**\n * add grant type\n * @param grantType\n */\n addRequestTokenUse(tokenUse: string): void {\n this.parameters.set(AADServerParamKeys.REQUESTED_TOKEN_USE, encodeURIComponent(tokenUse));\n }\n\n /**\n * add grant type\n * @param grantType\n */\n addGrantType(grantType: string): void {\n this.parameters.set(AADServerParamKeys.GRANT_TYPE, encodeURIComponent(grantType));\n }\n\n /**\n * add client info\n *\n */\n addClientInfo(): void {\n this.parameters.set(CLIENT_INFO, \"1\");\n }\n\n /**\n * add extraQueryParams\n * @param eQparams\n */\n addExtraQueryParameters(eQparams: StringDict): void {\n RequestValidator.sanitizeEQParams(eQparams, this.parameters);\n Object.keys(eQparams).forEach((key) => {\n this.parameters.set(key, eQparams[key]);\n });\n }\n\n addClientCapabilitiesToClaims(claims?: string, clientCapabilities?: Array<string>): string {\n let mergedClaims: object;\n\n // Parse provided claims into JSON object or initialize empty object\n if (!claims) {\n mergedClaims = {};\n } else {\n try {\n mergedClaims = JSON.parse(claims);\n } catch(e) {\n throw ClientConfigurationError.createInvalidClaimsRequestError();\n }\n }\n\n if (clientCapabilities && clientCapabilities.length > 0) {\n if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)){\n // Add access_token key to claims object\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};\n }\n\n // Add xms_cc claim with provided clientCapabilities to access_token key\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] = {\n values: clientCapabilities\n };\n }\n\n return JSON.stringify(mergedClaims);\n }\n\n /**\n * adds `username` for Password Grant flow\n * @param username\n */\n addUsername(username: string): void {\n this.parameters.set(PasswordGrantConstants.username, encodeURIComponent(username));\n }\n\n /**\n * adds `password` for Password Grant flow\n * @param password\n */\n addPassword(password: string): void {\n this.parameters.set(PasswordGrantConstants.password, encodeURIComponent(password));\n }\n\n /**\n * add pop_jwk to query params\n * @param cnfString\n */\n addPopToken(cnfString: string): void {\n if (!StringUtils.isEmpty(cnfString)) {\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));\n }\n }\n\n /**\n * add SSH JWK and key ID to query params\n */\n addSshJwk(sshJwkString: string): void {\n if(!StringUtils.isEmpty(sshJwkString)) {\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));\n }\n }\n\n /**\n * add server telemetry fields\n * @param serverTelemetryManager\n */\n addServerTelemetry(serverTelemetryManager: ServerTelemetryManager): void {\n this.parameters.set(AADServerParamKeys.X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());\n this.parameters.set(AADServerParamKeys.X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());\n }\n\n /**\n * Adds parameter that indicates to the server that throttling is supported\n */\n addThrottling(): void {\n this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);\n }\n\n /**\n * Adds logout_hint parameter for \"silent\" logout which prevent server account picker\n */\n addLogoutHint(logoutHint: string): void {\n this.parameters.set(AADServerParamKeys.LOGOUT_HINT, encodeURIComponent(logoutHint));\n }\n\n /**\n * Utility to create a URL from the params map\n */\n createQueryString(): string {\n const queryParameterArray: Array<string> = new Array<string>();\n\n this.parameters.forEach((value, key) => {\n queryParameterArray.push(`${key}=${value}`);\n });\n\n return queryParameterArray.join(\"&\");\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;AAGG;AAYH,IAAA,uBAAA,kBAAA,YAAA;AAII,IAAA,SAAA,uBAAA,GAAA;AACI,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;KAC/C;AAED;;AAEG;AACH,IAAA,uBAAA,CAAA,SAAA,CAAA,mBAAmB,GAAnB,YAAA;AACI,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CACf,kBAAkB,CAAC,aAAa,EAAE,kBAAkB,CAAC,SAAS,CAAC,kBAAkB,CAAC,CACrF,CAAC;KACL,CAAA;AAED;;AAEG;AACH,IAAA,uBAAA,CAAA,SAAA,CAAA,iCAAiC,GAAjC,YAAA;QACI,IAAI,CAAC,UAAU,CAAC,GAAG,CACf,kBAAkB,CAAC,aAAa,EAAE,kBAAkB,CAAI,SAAS,CAAC,mBAAmB,GAAI,GAAA,GAAA,SAAS,CAAC,sBAAwB,CAAC,CAC/H,C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I;IAQ7F;;;OAGG;IACH,MAAM,CAAC,2BAA2B,CAAC,mBAAmB,EAAE,MAAM,GAAI,IAAI;IAWtE;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAI,UAAU;CAc/F"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { StringUtils } from '../utils/StringUtils.js';
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
import { CodeChallengeMethodValues, PromptValue } from '../utils/Constants.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Validates server consumable params from the "request" objects
*/
var RequestValidator = /** @class */ (function () {
function RequestValidator() {
}
/**
* Utility to check if the `redirectUri` in the request is a non-null value
* @param redirectUri
*/
RequestValidator.validateRedirectUri = function (redirectUri) {
if (StringUtils.isEmpty(redirectUri)) {
throw ClientConfigurationError.createRedirectUriEmptyError();
}
};
/**
* Utility to validate prompt sent by the user in the request
* @param prompt
*/
RequestValidator.validatePrompt = function (prompt) {
var promptValues = [];
for (var value in PromptValue) {
promptValues.push(PromptValue[value]);
}
if (promptValues.indexOf(prompt) < 0) {
throw ClientConfigurationError.createInvalidPromptError(prompt);
}
};
RequestValidator.validateClaims = function (claims) {
try {
JSON.parse(claims);
}
catch (e) {
throw ClientConfigurationError.createInvalidClaimsRequestError();
}
};
/**
* Utility to validate code_challenge and code_challenge_method
* @param codeChallenge
* @param codeChallengeMethod
*/
RequestValidator.validateCodeChallengeParams = function (codeChallenge, codeChallengeMethod) {
if (StringUtils.isEmpty(codeChallenge) || StringUtils.isEmpty(codeChallengeMethod)) {
throw ClientConfigurationError.createInvalidCodeChallengeParamsError();
}
else {
this.validateCodeChallengeMethod(codeChallengeMethod);
}
};
/**
* Utility to validate code_challenge_method
* @param codeChallengeMethod
*/
RequestValidator.validateCodeChallengeMethod = function (codeChallengeMethod) {
if ([
CodeChallengeMethodValues.PLAIN,
CodeChallengeMethodValues.S256
].indexOf(codeChallengeMethod) < 0) {
throw ClientConfigurationError.createInvalidCodeChallengeMethodError();
}
};
/**
* Removes unnecessary or duplicate query parameters from extraQueryParameters
* @param request
*/
RequestValidator.sanitizeEQParams = function (eQParams, queryParams) {
if (!eQParams) {
return {};
}
// Remove any query parameters already included in SSO params
queryParams.forEach(function (value, key) {
if (eQParams[key]) {
delete eQParams[key];
}
});
return eQParams;
};
return RequestValidator;
}());
export { RequestValidator };
//# sourceMappingURL=RequestValidator.js.map
{"version":3,"file":"RequestValidator.js","sources":["../../src/request/RequestValidator.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { PromptValue, CodeChallengeMethodValues} from \"../utils/Constants\";\nimport { StringDict } from \"../utils/MsalTypes\";\n\n/**\n * Validates server consumable params from the \"request\" objects\n */\nexport class RequestValidator {\n\n /**\n * Utility to check if the `redirectUri` in the request is a non-null value\n * @param redirectUri\n */\n static validateRedirectUri(redirectUri: string) : void {\n if (StringUtils.isEmpty(redirectUri)) {\n throw ClientConfigurationError.createRedirectUriEmptyError();\n }\n }\n\n /**\n * Utility to validate prompt sent by the user in the request\n * @param prompt\n */\n static validatePrompt(prompt: string) : void {\n const promptValues = [];\n\n for (const value in PromptValue) {\n promptValues.push(PromptValue[value]);\n }\n\n if (promptValues.indexOf(prompt) < 0) {\n throw ClientConfigurationError.createInvalidPromptError(prompt);\n }\n }\n\n static validateClaims(claims: string) : void {\n try {\n JSON.parse(claims);\n } catch(e) {\n throw ClientConfigurationError.createInvalidClaimsRequestError();\n }\n }\n\n /**\n * Utility to validate code_challenge and code_challenge_method\n * @param codeChallenge\n * @param codeChallengeMethod\n */\n static validateCodeChallengeParams(codeChallenge: string, codeChallengeMethod: string) : void {\n if (StringUtils.isEmpty(codeChallenge) || StringUtils.isEmpty(codeChallengeMethod)) {\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\n } else {\n this.validateCodeChallengeMethod(codeChallengeMethod);\n }\n }\n\n /**\n * Utility to validate code_challenge_method\n * @param codeChallengeMethod\n */\n static validateCodeChallengeMethod(codeChallengeMethod: string) : void {\n if (\n [\n CodeChallengeMethodValues.PLAIN,\n CodeChallengeMethodValues.S256\n ].indexOf(codeChallengeMethod) < 0\n ) {\n throw ClientConfigurationError.createInvalidCodeChallengeMethodError();\n }\n }\n\n /**\n * Removes unnecessary or duplicate query parameters from extraQueryParameters\n * @param request\n */\n static sanitizeEQParams(eQParams: StringDict, queryParams: Map<string, string>) : StringDict {\n if (!eQParams) {\n return {};\n }\n\n // Remove any query parameters already included in SSO params\n queryParams.forEach((value, key) => {\n if (eQParams[key]) {\n delete eQParams[key];\n }\n });\n\n return eQParams;\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAOH;;AAEG;AACH,IAAA,gBAAA,kBAAA,YAAA;AAAA,IAAA,SAAA,gBAAA,GAAA;KAkFC;AAhFG;;;AAGG;IACI,gBAAmB,CAAA,mBAAA,GAA1B,UAA2B,WAAmB,EAAA;AAC1C,QAAA,IAAI,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;AAClC,YAAA,MAAM,wBAAwB,CAAC,2BAA2B,EAAE,CAAC;AAChE,SAAA;KACJ,CAAA;AAED;;;AAGG;IACI,gBAAc,CAAA,cAAA,GAArB,UAAsB,MAAc,EAAA;QAChC,IAAM,YAAY,GAAG,EAAE,CAAC;AAExB,QAAA,KAAK,IAAM,KAAK,IAAI,WAAW,EAAE;YAC7B,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;AACzC,SAAA;QAED,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;AAClC,YAAA,MAAM,wBAAwB,CAAC,wBAAwB,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G,CAAC,CAAC;AACxB,aAAA;AACL,SAAC,CAAC,CAAC;AAEH,QAAA,OAAO,QAAQ,CAAC;KACnB,CAAA;IACL,OAAC,gBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
\ No newline at end of file
{"version":3,"file":"ScopeSet.d.ts","sourceRoot":"","sources":["../../src/request/ScopeSet.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,qBAAa,QAAQ;IAEjB,OAAO,CAAC,MAAM,CAAc;gBAEhB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;IAYtC;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,gBAAgB,EAAE,MAAM,GAAG,QAAQ;IAMrD;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAO3B;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAOrC;;;OAGG;IACH,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;IAQ7C;;OAEG;IACH,sBAAsB,IAAI,OAAO;IAWjC;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMnC;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAQ5C;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOhC;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAMxB;;;OAGG;IACH,cAAc,CAAC,WAAW,EAAE,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC;IAUlD;;;OAGG;IACH,qBAAqB,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO;IAgBrD;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;IAMxB;;OAEG;IACH,WAAW,IAAI,MAAM;IAQrB;;OAEG;IACH,oBAAoB,IAAI,MAAM;CAGjC"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { __spreadArrays } from '../_virtual/_tslib.js';
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
import { StringUtils } from '../utils/StringUtils.js';
import { ClientAuthError } from '../error/ClientAuthError.js';
import { OIDC_SCOPES, Constants } from '../utils/Constants.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes
* the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions
* to ensure uniqueness of strings.
*/
var ScopeSet = /** @class */ (function () {
function ScopeSet(inputScopes) {
var _this = this;
// Filter empty string and null/undefined array items
var scopeArr = inputScopes ? StringUtils.trimArrayEntries(__spreadArrays(inputScopes)) : [];
var filteredInput = scopeArr ? StringUtils.removeEmptyStringsFromArray(scopeArr) : [];
// Validate and filter scopes (validate function throws if validation fails)
this.validateInputScopes(filteredInput);
this.scopes = new Set(); // Iterator in constructor not supported by IE11
filteredInput.forEach(function (scope) { return _this.scopes.add(scope); });
}
/**
* Factory method to create ScopeSet from space-delimited string
* @param inputScopeString
* @param appClientId
* @param scopesRequired
*/
ScopeSet.fromString = function (inputScopeString) {
var scopeString = inputScopeString || Constants.EMPTY_STRING;
var inputScopes = scopeString.split(" ");
return new ScopeSet(inputScopes);
};
/**
* Used to validate the scopes input parameter requested by the developer.
* @param {Array<string>} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.
* @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not
*/
ScopeSet.prototype.validateInputScopes = function (inputScopes) {
// Check if scopes are required but not given or is an empty array
if (!inputScopes || inputScopes.length < 1) {
throw ClientConfigurationError.createEmptyScopesArrayError();
}
};
/**
* Check if a given scope is present in this set of scopes.
* @param scope
*/
ScopeSet.prototype.containsScope = function (scope) {
var lowerCaseScopes = this.printScopesLowerCase().split(" ");
var lowerCaseScopesSet = new ScopeSet(lowerCaseScopes);
// compare lowercase scopes
return !StringUtils.isEmpty(scope) ? lowerCaseScopesSet.scopes.has(scope.toLowerCase()) : false;
};
/**
* Check if a set of scopes is present in this set of scopes.
* @param scopeSet
*/
ScopeSet.prototype.containsScopeSet = function (scopeSet) {
var _this = this;
if (!scopeSet || scopeSet.scopes.size <= 0) {
return false;
}
return (this.scopes.size >= scopeSet.scopes.size && scopeSet.asArray().every(function (scope) { return _this.containsScope(scope); }));
};
/**
* Check if set of scopes contains only the defaults
*/
ScopeSet.prototype.containsOnlyOIDCScopes = function () {
var _this = this;
var defaultScopeCount = 0;
OIDC_SCOPES.forEach(function (defaultScope) {
if (_this.containsScope(defaultScope)) {
defaultScopeCount += 1;
}
});
return this.scopes.size === defaultScopeCount;
};
/**
* Appends single scope if passed
* @param newScope
*/
ScopeSet.prototype.appendScope = function (newScope) {
if (!StringUtils.isEmpty(newScope)) {
this.scopes.add(newScope.trim());
}
};
/**
* Appends multiple scopes if passed
* @param newScopes
*/
ScopeSet.prototype.appendScopes = function (newScopes) {
var _this = this;
try {
newScopes.forEach(function (newScope) { return _this.appendScope(newScope); });
}
catch (e) {
throw ClientAuthError.createAppendScopeSetError(e);
}
};
/**
* Removes element from set of scopes.
* @param scope
*/
ScopeSet.prototype.removeScope = function (scope) {
if (StringUtils.isEmpty(scope)) {
throw ClientAuthError.createRemoveEmptyScopeFromSetError(scope);
}
this.scopes.delete(scope.trim());
};
/**
* Removes default scopes from set of scopes
* Primarily used to prevent cache misses if the default scopes are not returned from the server
*/
ScopeSet.prototype.removeOIDCScopes = function () {
var _this = this;
OIDC_SCOPES.forEach(function (defaultScope) {
_this.scopes.delete(defaultScope);
});
};
/**
* Combines an array of scopes with the current set of scopes.
* @param otherScopes
*/
ScopeSet.prototype.unionScopeSets = function (otherScopes) {
if (!otherScopes) {
throw ClientAuthError.createEmptyInputScopeSetError();
}
var unionScopes = new Set(); // Iterator in constructor not supported in IE11
otherScopes.scopes.forEach(function (scope) { return unionScopes.add(scope.toLowerCase()); });
this.scopes.forEach(function (scope) { return unionScopes.add(scope.toLowerCase()); });
return unionScopes;
};
/**
* Check if scopes intersect between this set and another.
* @param otherScopes
*/
ScopeSet.prototype.intersectingScopeSets = function (otherScopes) {
if (!otherScopes) {
throw ClientAuthError.createEmptyInputScopeSetError();
}
// Do not allow OIDC scopes to be the only intersecting scopes
if (!otherScopes.containsOnlyOIDCScopes()) {
otherScopes.removeOIDCScopes();
}
var unionScopes = this.unionScopeSets(otherScopes);
var sizeOtherScopes = otherScopes.getScopeCount();
var sizeThisScopes = this.getScopeCount();
var sizeUnionScopes = unionScopes.size;
return sizeUnionScopes < (sizeThisScopes + sizeOtherScopes);
};
/**
* Returns size of set of scopes.
*/
ScopeSet.prototype.getScopeCount = function () {
return this.scopes.size;
};
/**
* Returns the scopes as an array of string values
*/
ScopeSet.prototype.asArray = function () {
var array = [];
this.scopes.forEach(function (val) { return array.push(val); });
return array;
};
/**
* Prints scopes into a space-delimited string
*/
ScopeSet.prototype.printScopes = function () {
if (this.scopes) {
var scopeArr = this.asArray();
return scopeArr.join(" ");
}
return Constants.EMPTY_STRING;
};
/**
* Prints scopes into a space-delimited lower-case string (used for caching)
*/
ScopeSet.prototype.printScopesLowerCase = function () {
return this.printScopes().toLowerCase();
};
return ScopeSet;
}());
export { ScopeSet };
//# sourceMappingURL=ScopeSet.js.map
{"version":3,"file":"ScopeSet.js","sources":["../../src/request/ScopeSet.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { Constants, OIDC_SCOPES } from \"../utils/Constants\";\n\n/**\n * The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes\n * the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions\n * to ensure uniqueness of strings.\n */\nexport class ScopeSet {\n // Scopes as a Set of strings\n private scopes: Set<string>;\n\n constructor(inputScopes: Array<string>) {\n // Filter empty string and null/undefined array items\n const scopeArr = inputScopes ? StringUtils.trimArrayEntries([...inputScopes]) : [];\n const filteredInput = scopeArr ? StringUtils.removeEmptyStringsFromArray(scopeArr) : [];\n\n // Validate and filter scopes (validate function throws if validation fails)\n this.validateInputScopes(filteredInput);\n\n this.scopes = new Set<string>(); // Iterator in constructor not supported by IE11\n filteredInput.forEach(scope => this.scopes.add(scope));\n }\n\n /**\n * Factory method to create ScopeSet from space-delimited string\n * @param inputScopeString\n * @param appClientId\n * @param scopesRequired\n */\n static fromString(inputScopeString: string): ScopeSet {\n const scopeString = inputScopeString || Constants.EMPTY_STRING;\n const inputScopes: Array<string> = scopeString.split(\" \");\n return new ScopeSet(inputScopes);\n }\n\n /**\n * Used to validate the scopes input parameter requested by the developer.\n * @param {Array<string>} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\n * @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not\n */\n private validateInputScopes(inputScopes: Array<string>): void {\n // Check if scopes are required but not given or is an empty array\n if (!inputScopes || inputScopes.length < 1) {\n throw ClientConfigurationError.createEmptyScopesArrayError();\n }\n }\n\n /**\n * Check if a given scope is present in this set of scopes.\n * @param scope\n */\n containsScope(scope: string): boolean {\n const lowerCaseScopes = this.printScopesLowerCase().split(\" \");\n const lowerCaseScopesSet = new ScopeSet(lowerCaseScopes);\n // compare lowercase scopes\n return !StringUtils.isEmpty(scope) ? lowerCaseScopesSet.scopes.has(scope.toLowerCase()) : false;\n }\n\n /**\n * Check if a set of scopes is present in this set of scopes.\n * @param scopeSet\n */\n containsScopeSet(scopeSet: ScopeSet): boolean {\n if (!scopeSet || scopeSet.scopes.size <= 0) {\n return false;\n }\n\n return (this.scopes.size >= scopeSet.scopes.size && scopeSet.asArray().every(scope => this.containsScope(scope)));\n }\n\n /**\n * Check if set of scopes contains only the defaults\n */\n containsOnlyOIDCScopes(): boolean {\n let defaultScopeCount = 0;\n OIDC_SCOPES.forEach((defaultScope: string) => {\n if (this.containsScope(defaultScope)) {\n defaultScopeCount += 1;\n }\n });\n\n return this.scopes.size === defaultScopeCount;\n }\n\n /**\n * Appends single scope if passed\n * @param newScope\n */\n appendScope(newScope: string): void {\n if (!StringUtils.isEmpty(newScope)) {\n this.scopes.add(newScope.trim());\n }\n }\n\n /**\n * Appends multiple scopes if passed\n * @param newScopes\n */\n appendScopes(newScopes: Array<string>): void {\n try {\n newScopes.forEach(newScope => this.appendScope(newScope));\n } catch (e) {\n throw ClientAuthError.createAppendScopeSetError(e);\n }\n }\n\n /**\n * Removes element from set of scopes.\n * @param scope\n */\n removeScope(scope: string): void {\n if (StringUtils.isEmpty(scope)) {\n throw ClientAuthError.createRemoveEmptyScopeFromSetError(scope);\n }\n this.scopes.delete(scope.trim());\n }\n\n /**\n * Removes default scopes from set of scopes\n * Primarily used to prevent cache misses if the default scopes are not returned from the server\n */\n removeOIDCScopes(): void {\n OIDC_SCOPES.forEach((defaultScope: string) => {\n this.scopes.delete(defaultScope);\n });\n }\n\n /**\n * Combines an array of scopes with the current set of scopes.\n * @param otherScopes\n */\n unionScopeSets(otherScopes: ScopeSet): Set<string> {\n if (!otherScopes) {\n throw ClientAuthError.createEmptyInputScopeSetError();\n }\n const unionScopes = new Set<string>(); // Iterator in constructor not supported in IE11\n otherScopes.scopes.forEach(scope => unionScopes.add(scope.toLowerCase()));\n this.scopes.forEach(scope => unionScopes.add(scope.toLowerCase()));\n return unionScopes;\n }\n\n /**\n * Check if scopes intersect between this set and another.\n * @param otherScopes\n */\n intersectingScopeSets(otherScopes: ScopeSet): boolean {\n if (!otherScopes) {\n throw ClientAuthError.createEmptyInputScopeSetError();\n }\n \n // Do not allow OIDC scopes to be the only intersecting scopes\n if (!otherScopes.containsOnlyOIDCScopes()) {\n otherScopes.removeOIDCScopes();\n }\n const unionScopes = this.unionScopeSets(otherScopes);\n const sizeOtherScopes = otherScopes.getScopeCount();\n const sizeThisScopes = this.getScopeCount();\n const sizeUnionScopes = unionScopes.size;\n return sizeUnionScopes < (sizeThisScopes + sizeOtherScopes);\n }\n\n /**\n * Returns size of set of scopes.\n */\n getScopeCount(): number {\n return this.scopes.size;\n }\n\n /**\n * Returns the scopes as an array of string values\n */\n asArray(): Array<string> {\n const array: Array<string> = [];\n this.scopes.forEach(val => array.push(val));\n return array;\n }\n\n /**\n * Prints scopes into a space-delimited string\n */\n printScopes(): string {\n if (this.scopes) {\n const scopeArr = this.asArray();\n return scopeArr.join(\" \");\n }\n return Constants.EMPTY_STRING;\n }\n\n /**\n * Prints scopes into a space-delimited lower-case string (used for caching)\n */\n printScopesLowerCase(): string {\n return this.printScopes().toLowerCase();\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;AAGG;AAOH;;;;AAIG;AACH,IAAA,QAAA,kBAAA,YAAA;AAII,IAAA,SAAA,QAAA,CAAY,WAA0B,EAAA;QAAtC,IAUC,KAAA,GAAA,IAAA,CAAA;;AARG,QAAA,IAAM,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC,gBAAgB,CAAA,cAAA,CAAK,WAAW,CAAE,CAAA,GAAG,EAAE,CAAC;AACnF,QAAA,IAAM,aAAa,GAAG,QAAQ,GAAG,WAAW,CAAC,2BAA2B,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;;AAGxF,QAAA,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;QAExC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AAChC,QAAA,aAAa,CAAC,OAAO,CAAC,UAAA,KAAK,EAAA,EAAI,OAAA,KAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAtB,EAAsB,CAAC,CAAC;KAC1D;AAED;;;;;AAKG;IACI,QAAU,CAAA,UAAA,GAAjB,UAAkB,gBAAwB,EAAA;AACtC,QAAA,IAAM,WAAW,GAAG,gBAAgB,IAAI,SAAS,C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CAAC,WAAW,CAAC,CAAC;AACrD,QAAA,IAAM,eAAe,GAAG,WAAW,CAAC,aAAa,EAAE,CAAC;AACpD,QAAA,IAAM,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;AAC5C,QAAA,IAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CAAC;AACzC,QAAA,OAAO,eAAe,IAAI,cAAc,GAAG,eAAe,CAAC,CAAC;KAC/D,CAAA;AAED;;AAEG;AACH,IAAA,QAAA,CAAA,SAAA,CAAA,aAAa,GAAb,YAAA;AACI,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KAC3B,CAAA;AAED;;AAEG;AACH,IAAA,QAAA,CAAA,SAAA,CAAA,OAAO,GAAP,YAAA;QACI,IAAM,KAAK,GAAkB,EAAE,CAAC;AAChC,QAAA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,GAAG,EAAI,EAAA,OAAA,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAf,EAAe,CAAC,CAAC;AAC5C,QAAA,OAAO,KAAK,CAAC;KAChB,CAAA;AAED;;AAEG;AACH,IAAA,QAAA,CAAA,SAAA,CAAA,WAAW,GAAX,YAAA;QACI,IAAI,IAAI,CAAC,MAAM,EAAE;AACb,YAAA,IAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;AAChC,YAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7B,SAAA;QACD,OAAO,SAAS,CAAC,YAAY,CAAC;KACjC,CAAA;AAED;;AAEG;AACH,IAAA,QAAA,CAAA,SAAA,CAAA,oBAAoB,GAApB,YAAA;AACI,QAAA,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC;KAC3C,CAAA;IACL,OAAC,QAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
\ No newline at end of file
import { AccountInfo } from "../account/AccountInfo";
/**
* Result returned from the authority's token endpoint.
* - uniqueId - `oid` or `sub` claim from ID token
* - tenantId - `tid` claim from ID token
* - scopes - Scopes that are validated for the respective token
* - account - An account object representation of the currently signed-in user
* - idToken - Id token received as part of the response
* - idTokenClaims - MSAL-relevant ID token claims
* - accessToken - Access token or SSH certificate received as part of the response
* - fromCache - Boolean denoting whether token came from cache
* - expiresOn - Javascript Date object representing relative expiration of access token
* - extExpiresOn - Javascript Date object representing extended relative expiration of access token in case of server outage
* - state - Value passed in by user in request
* - familyId - Family ID identifier, usually only used for refresh tokens
* - requestId - Request ID returned as part of the response
*/
export declare type AuthenticationResult = {
authority: string;
uniqueId: string;
tenantId: string;
scopes: Array<string>;
account: AccountInfo | null;
idToken: string;
idTokenClaims: object;
accessToken: string;
fromCache: boolean;
expiresOn: Date | null;
tokenType: string;
correlationId: string;
requestId?: string;
extExpiresOn?: Date;
state?: string;
familyId?: string;
cloudGraphHostName?: string;
msGraphHost?: string;
code?: string;
fromNativeBroker?: boolean;
};
//# sourceMappingURL=AuthenticationResult.d.ts.map
\ No newline at end of file
{"version":3,"file":"AuthenticationResult.d.ts","sourceRoot":"","sources":["../../src/response/AuthenticationResult.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,oBAAoB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC"}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment