UNPKG

@azure/msal-browser

Version:
64 lines (61 loc) • 2.01 kB
/*! @azure/msal-browser v5.30.0 2026-11-18 */ 'use strict'; import { Constants } from '@azure/msal-common/browser'; /* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ /** * Key storage enclaves supported by the platform broker. */ const PlatformAuthEnclave = { /** * Persisted software key using MS_KEY_STORAGE_PROVIDER. */ SOFTWARE: "sw"}; /** * Token types supported by the platform broker request contract. */ const PlatformAuthTokenType = { DPOP_WITH_PROOF: "dpop+proof", }; /** * Token binding preferences supported by the platform broker. */ const PlatformAuthBindingPreference = { ATTESTED: "attested", }; const PROOF_OF_POSSESSION_TOKEN_TYPES = [ Constants.AuthenticationScheme.POP, Constants.AuthenticationScheme.DPOP, PlatformAuthTokenType.DPOP_WITH_PROOF, ]; /** * Returns whether a platform broker token type requires proof request metadata. */ function isProofOfPossessionTokenType(tokenType) { return (tokenType !== undefined && PROOF_OF_POSSESSION_TOKEN_TYPES.includes(tokenType)); } /** * Adds canonical proof request fields to the broker no-cache property bag. */ function createPlatformAuthExtraParametersNoCache(tokenType, resourceRequestMethod, resourceRequestUri, dpopNonce) { if (!isProofOfPossessionTokenType(tokenType)) { return undefined; } return { ...(resourceRequestMethod && { pop_method: resourceRequestMethod, }), ...(resourceRequestUri && { pop_url: resourceRequestUri, }), ...(tokenType === PlatformAuthTokenType.DPOP_WITH_PROOF && dpopNonce && { pop_nonce: dpopNonce, }), }; } export { PlatformAuthBindingPreference, PlatformAuthEnclave, PlatformAuthTokenType, createPlatformAuthExtraParametersNoCache, isProofOfPossessionTokenType }; //# sourceMappingURL=PlatformAuthRequest.mjs.map