{"record":{"id":"4beb93dca3c266b3","repo":"serverless/serverless","slug":"gateway-jwt-authorizer-requires-discoveryurl","errorCode":null,"errorMessage":"Gateway JWT authorizer requires discoveryUrl","messagePattern":"Gateway JWT authorizer requires discoveryUrl","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/serverless/lib/plugins/aws/bedrock-agentcore/compilers/gateway.js","lineNumber":44,"sourceCode":" *     WorkloadIdentityDetails\n */\n\nimport { getLogicalId, getGatewayResourceName } from '../utils/naming.js'\nimport { resolveRole } from '../utils/role.js'\nimport { transformCustomClaims } from '../utils/authorizer.js'\n\n/**\n * Build authorizer configuration for the gateway\n */\nexport function buildGatewayAuthorizerConfiguration(authConfig) {\n  if (!authConfig || !authConfig.jwt) {\n    return null\n  }\n\n  const jwtConfig = authConfig.jwt\n\n  if (!jwtConfig.discoveryUrl) {\n    throw new Error('Gateway JWT authorizer requires discoveryUrl')\n  }\n\n  const transformedClaims = transformCustomClaims(jwtConfig.customClaims)\n\n  return {\n    CustomJWTAuthorizer: {\n      DiscoveryUrl: jwtConfig.discoveryUrl,\n      ...(jwtConfig.allowedAudience && {\n        AllowedAudience: jwtConfig.allowedAudience,\n      }),\n      ...(jwtConfig.allowedClients && {\n        AllowedClients: jwtConfig.allowedClients,\n      }),\n      ...(jwtConfig.allowedScopes && {\n        AllowedScopes: jwtConfig.allowedScopes,\n      }),\n      ...(transformedClaims && {\n        CustomClaims: transformedClaims,","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/serverless/serverless/blob/b9d7ea51c8cce57cff1207964b9b71123673081f/packages/serverless/lib/plugins/aws/bedrock-agentcore/compilers/gateway.js#L26-L62","documentation":"Error \"Gateway JWT authorizer requires discoveryUrl\" thrown in serverless/serverless.","triggerScenarios":"Thrown at packages/serverless/lib/plugins/aws/bedrock-agentcore/compilers/gateway.js:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add discoveryUrl to the gateway JWT authorizer configuration pointing at the OIDC discovery document."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b9d7ea51c8cce57cff1207964b9b71123673081f","analyzedAt":"2026-08-13T04:14:40.386Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}