UNPKG

@azure/msal-browser

Version:
50 lines (47 loc) • 1.62 kB
/*! @azure/msal-browser v5.25.0 2026-10-06 */ 'use strict'; import { Constants } from '@azure/msal-common/browser'; /* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ /** * Token types supported by the platform broker request contract. */ const PlatformAuthTokenType = { DPOP_WITH_PROOF: "dpop+proof", }; 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(extraParametersNoCache, isProofOfPossessionRequest, resourceRequestMethod, resourceRequestUri, dpopNonce) { if (!isProofOfPossessionRequest) { return extraParametersNoCache; } return { ...extraParametersNoCache, ...(resourceRequestMethod && { pop_method: resourceRequestMethod, }), ...(resourceRequestUri && { pop_url: resourceRequestUri, }), ...(dpopNonce && { pop_nonce: dpopNonce, }), }; } export { PlatformAuthTokenType, createPlatformAuthExtraParametersNoCache, isProofOfPossessionTokenType }; //# sourceMappingURL=PlatformAuthRequest.mjs.map