Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/client/src/client/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,10 @@ export async function executeTokenRequest(
applyClientAuthentication(authMethod, clientInformation as OAuthClientInformation, headers, tokenRequestParams);
}

// Ensure Content-Type is always form-urlencoded for the token endpoint (OAuth 2.1 §3.2).
// Some addClientAuthentication implementations may have inadvertently set a different value.
headers.set('Content-Type', 'application/x-www-form-urlencoded');

const response = await (fetchFn ?? fetch)(tokenUrl, {
method: 'POST',
headers,
Expand Down
Loading