{"record":{"id":"63489d5d8d7a0a10","repo":"microsoft/vscode","slug":"permissive-authentication-is-required","errorCode":null,"errorMessage":"Permissive authentication is required","messagePattern":"Permissive authentication is required","errorType":"exception","errorClass":"PermissiveAuthRequiredError","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/chatSessions/copilotcli/node/missionControlApiClient.ts","lineNumber":205,"sourceCode":"\t/**\n\t * Build the absolute URL and auth headers for an MC request.\n\t *\n\t * Request a permissive GitHub session, optionally with an interactive upgrade prompt.\n\t * If no session is available and prompting is disabled, throw\n\t * {@link PermissiveAuthRequiredError} so callers can render a dedicated UX.\n\t *\n\t * The base URL is resolved via the Copilot token's `endpoints.api` which is\n\t * GHES-aware.\n\t */\n\tprivate async _buildRequest(\n\t\tpath: string,\n\t\tauthOptions: McAuthOptions,\n\t): Promise<{ url: string; headers: Record<string, string> }> {\n\t\tconst session = authOptions.createIfNone\n\t\t\t? await this._authService.getGitHubSession('permissive', { createIfNone: authOptions.createIfNone })\n\t\t\t: await this._authService.getGitHubSession('permissive', { silent: true });\n\t\tif (!session?.accessToken) {\n\t\t\tthrow new PermissiveAuthRequiredError();\n\t\t}\n\n\t\tconst copilotToken = await this._authService.getCopilotToken();\n\t\tconst baseUrl = copilotToken.endpoints?.api;\n\t\tif (!baseUrl) {\n\t\t\tthrow new Error('Copilot API endpoint is not available');\n\t\t}\n\n\t\tconst url = `${baseUrl.replace(/\\/+$/, '')}${path}`;\n\t\tconst headers: Record<string, string> = {\n\t\t\t'Authorization': `Bearer ${session.accessToken}`,\n\t\t\t'Copilot-Integration-Id': INTEGRATION_ID,\n\t\t};\n\t\treturn { url, headers };\n\t}\n}\n","sourceCodeStart":187,"sourceCodeEnd":222,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/chatSessions/copilotcli/node/missionControlApiClient.ts#L187-L222","documentation":"Error \"Permissive authentication is required\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/chatSessions/copilotcli/node/missionControlApiClient.ts:205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"a94b963a32aa9749d69504576791fa29700ae46d","analyzedAt":"2026-08-12T01:08:56.794Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}