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
10 changes: 10 additions & 0 deletions client/src/lib/oauth-state-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
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,
Expand Down