{"record":{"id":"42fc7a1e6c7c49a2","repo":"hasura/graphql-engine","slug":"jwt-authorization-token-source-header-name-heade","errorCode":null,"errorMessage":"JWT Authorization token source: Header name {header_name} not found.","messagePattern":"JWT Authorization token source: Header name (.+?) not found\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/auth/hasura-authn-jwt/src/jwt.rs","lineNumber":48,"sourceCode":"    ErrorDecodingAuthorizationHeader(jwt::errors::Error),\n    #[error(\"`kid` (Key ID) header claim not found in the header\")]\n    KidHeaderNotFound,\n    #[error(\"Expected the Hasura claims to be a String when `claimsFormat` is `stringifiedJson`\")]\n    ExpectedStringifiedJson,\n    #[error(\"The default role is not present in the allowed roles\")]\n    DisallowedDefaultRole,\n    #[error(\"The specified role is not present in the allowed roles\")]\n    DisallowedRole,\n    #[error(\"Error while parsing the claims map entry: {claim_name} - {err}\")]\n    ParseClaimsMapEntryError {\n        claim_name: String,\n        err: serde_json::Error,\n    },\n    #[error(\"Expected string value for claim {claim_name}\")]\n    ClaimMustBeAString { claim_name: String },\n    #[error(\"Required claim {claim_name} not found\")]\n    RequiredClaimNotFound { claim_name: String },\n    #[error(\"JWT Authorization token source: Header name {header_name} not found.\")]\n    AuthorizationHeaderSourceNotFound { header_name: String },\n    #[error(\"JWT Authorization token source: Cookie header not found\")]\n    CookieNotFound,\n    #[error(\n        \"JWT Authorization token source: cookie name {cookie_name} not found in the Cookie header\"\n    )]\n    CookieNameNotFound { cookie_name: String },\n    #[error(\"Error in parsing the {header_name} header: {err}\")]\n    AuthorizationHeaderParseError { err: String, header_name: String },\n    #[error(\"Error in parsing the Cookie header value: {err}\")]\n    CookieParseError { err: cookie::ParseError },\n    #[error(\"Missing corresponding value for the cookie with cookie name: {cookie_name}\")]\n    MissingCookieValue { cookie_name: String },\n    #[error(\"JWT validation error: {0}\")]\n    JWTValidationError(jwt::errors::Error),\n    #[error(\"Internal Error - {0}\")]\n    Internal(#[from] InternalError),\n}","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/auth/hasura-authn-jwt/src/jwt.rs#L30-L66","documentation":"The JWT is configured to be read from a custom HTTP header (`{header_name}`), but the incoming request does not contain that header.","triggerScenarios":"Auth mode is header-based JWT with a custom header name (e.g. `X-Auth-Token`) and the client sends the token elsewhere (Authorization header, cookie) or not at all.","commonSituations":"Client SDK not yet updated to send the custom header; header name typo in metadata vs. client; proxies/gateways stripping custom headers; CORS preflight not allowing the custom header.","solutions":["Verify the client sends the exact header name shown in {header_name}","Correct the configured header name in JWT config if it's a typo","Ensure proxies/gateways forward the custom header","Add the custom header to allowed CORS headers if browser clients are used"],"exampleFix":"// before: client sends Authorization: Bearer <token> but config expects X-Auth-Token\n// after: client sends X-Auth-Token: <token>","handlingStrategy":"validation","validationCode":"const token = req.headers.get(config.jwtHeaderName);\nif (!token) return unauthorized(`missing header ${config.jwtHeaderName}`);","typeGuard":"const hasHeader = (h: Headers, n: string): h is Headers & Record<n,string> => h.get(n) !== null;","tryCatchPattern":"Return 401 with the expected header name; no retry (client must resend with header).","preventionTips":["Document the custom header for all client SDKs","Ensure proxies forward custom headers and CORS allows them"],"tags":["jwt","http-headers","auth"],"backgroundTag":"missing-auth-header","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}