From e6c5f0fca224df4bfd164bb43cf3a7c76c2886e1 Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Sat, 28 Mar 2026 10:38:52 +0100 Subject: [PATCH] oauth fix --- src/McpServer/autopilot-monitor-mcp/src/oauth.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/McpServer/autopilot-monitor-mcp/src/oauth.ts b/src/McpServer/autopilot-monitor-mcp/src/oauth.ts index 9b37977d..290257c6 100644 --- a/src/McpServer/autopilot-monitor-mcp/src/oauth.ts +++ b/src/McpServer/autopilot-monitor-mcp/src/oauth.ts @@ -14,6 +14,7 @@ import { Router } from 'express'; const CLIENT_ID = process.env.AUTOPILOT_ENTRA_CLIENT_ID ?? '1a400946-62c1-4ab4-aa37-f730ac89704d'; +const CLIENT_SECRET = process.env.AUTOPILOT_ENTRA_CLIENT_SECRET ?? ''; const AUTHORITY = process.env.AUTOPILOT_ENTRA_AUTHORITY ?? 'https://login.microsoftonline.com/organizations'; const SCOPES = `api://${CLIENT_ID}/access_as_user openid profile offline_access`; @@ -121,6 +122,7 @@ export function createOAuthRouter(): Router { console.error(`[oauth/token] has code=${!!params.code}, has code_verifier=${!!params.code_verifier}, has refresh_token=${!!params.refresh_token}`); body.set('client_id', CLIENT_ID); + if (CLIENT_SECRET) body.set('client_secret', CLIENT_SECRET); body.set('redirect_uri', `${baseUrl}/oauth/callback`); if (params.grant_type) body.set('grant_type', params.grant_type);