mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-03 18:38:35 +02:00
feat: use GitHub Copilot client ID as default for MCP OAuth
Use the well-known Copilot client ID (aebc6443-996d-45c2-90f0-388ff96faa56) when no static client config is provided and the auth server doesn't support dynamic client registration. This matches how VS Code authenticates with Entra ID-backed MCP servers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -61,8 +61,13 @@ export async function performMcpOAuthFlow(options: McpOAuthFlowOptions): Promise
|
||||
const authServerUrl = await discoverAuthorizationServer(serverUrl);
|
||||
const metadata = await fetchAuthServerMetadata(authServerUrl);
|
||||
|
||||
// Use explicit static config, fall back to the well-known GitHub Copilot client ID,
|
||||
// and only attempt dynamic registration as a last resort.
|
||||
const COPILOT_CLIENT_ID = 'aebc6443-996d-45c2-90f0-388ff96faa56';
|
||||
const clientId = staticClientConfig?.clientId
|
||||
?? await dynamicClientRegistration(metadata, serverUrl);
|
||||
?? (metadata.registration_endpoint
|
||||
? await dynamicClientRegistration(metadata, serverUrl)
|
||||
: COPILOT_CLIENT_ID);
|
||||
|
||||
const { verifier, challenge } = generatePkceChallenge();
|
||||
const { port, redirectUri, waitForCallback, close } = await startCallbackServer();
|
||||
|
||||
Reference in New Issue
Block a user