From 2ce233efcd66d0d45e563b89d3fc9cb71324fa8a Mon Sep 17 00:00:00 2001 From: Kyle Leonhard <4945355+kyle-leonhard@users.noreply.github.com> Date: Thu, 24 Jul 2025 10:21:46 -0700 Subject: [PATCH] Set a preferred auth method on the client registration --- client/src/lib/oauth-state-machine.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/src/lib/oauth-state-machine.ts b/client/src/lib/oauth-state-machine.ts index d87b3ecd6..f2ab249ae 100644 --- a/client/src/lib/oauth-state-machine.ts +++ b/client/src/lib/oauth-state-machine.ts @@ -88,6 +88,16 @@ export const oauthTransitions: Record = { clientMetadata.scope = scopesSupported.join(" "); } + // Select a preferred auth method + const authMethodsSupported = + metadata.token_endpoint_auth_methods_supported; + for (const authMethod of ["client_secret_basic", "client_secret_post"]) { + if (authMethodsSupported && authMethodsSupported.includes(authMethod)) { + clientMetadata.token_endpoint_auth_method = authMethod; + break; + } + } + const fullInformation = await registerClient(context.serverUrl, { metadata, clientMetadata,