diff --git a/BlazorApp/Services/DeveloperApplicationService.cs b/BlazorApp/Services/DeveloperApplicationService.cs index 234a1ac..8455dae 100644 --- a/BlazorApp/Services/DeveloperApplicationService.cs +++ b/BlazorApp/Services/DeveloperApplicationService.cs @@ -81,11 +81,15 @@ public class DeveloperApplicationService Category = "Developer Program" }; + // Use a fresh HttpClient without the X-API-Key default header so that + // SilverDESK's MultiAuth policy routes to Bearer/JWT auth (the new user's token) + // instead of ApiKey auth (which resolves to the MCP system user). + using var userClient = new HttpClient { BaseAddress = _httpClient.BaseAddress }; var ticketRequest = new HttpRequestMessage(HttpMethod.Post, "/api/tickets"); ticketRequest.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token); ticketRequest.Content = JsonContent.Create(ticketPayload); - var ticketResponse = await _httpClient.SendAsync(ticketRequest); + var ticketResponse = await userClient.SendAsync(ticketRequest); if (!ticketResponse.IsSuccessStatusCode) {