From 54b6f1e90184381b74e5ab1a263d68614b74afe3 Mon Sep 17 00:00:00 2001 From: raghavyuva Date: Wed, 8 Apr 2026 14:39:00 +0530 Subject: [PATCH] fix: pass resource param in M2M token request for JWT issuance Without the resource parameter, the auth service returns an opaque token instead of a JWT. The API requires a JWT for M2M auth validation via JWKS. Pass config.apiUrl as the resource so the token includes the correct audience claim. --- src/features/incidents/incidents.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/features/incidents/incidents.ts b/src/features/incidents/incidents.ts index 1b43a29..9a69ccc 100644 --- a/src/features/incidents/incidents.ts +++ b/src/features/incidents/incidents.ts @@ -57,6 +57,7 @@ export async function getM2MToken(): Promise { grant_type: 'client_credentials', client_id: clientId, client_secret: clientSecret, + ...(config.apiUrl ? { resource: config.apiUrl } : {}), }); const res = await fetch(tokenUrl, {