MuleSoft · JWT Validation policy
400 Token was not provided in the request
Short answer
An API protected by the JWT Validation policy returns 400 when the request carries no token where the policy looks for it. Send the JWT in the place the policy's JWT Origin and Token Expression settings name.
VerifiedLast verified
01Error text
400 - Token was not provided in the request.02Likely causes
- The token was not provided in the request.
- The token is sent somewhere other than where the policy's JWT Origin or Token Expression reads it.
03How to fix it
- Open the policy configuration in API Manager and check JWT Origin and, if it is used, Token Expression.
- Send the JWT in that location on every request.
- Repeat the request.
04Official documentation
→Related errors
- 401 from the JWT Validation policyAn API protected by the JWT Validation policy returns 401 when the token's signature is invalid, a required claim is missing or fails validation, or the token cannot be parsed. Compare the token with the policy's signing method, key and claim settings.
- 401 Unauthorized or invalid client application credentialsAn API protected by the Client ID Enforcement policy returns 401 when the client application's credentials are missing, invalid or not authorized. The client needs an approved contract for the API and must send matching credentials on every request.
- HTTP:BAD_REQUESTHTTP:BAD_REQUEST means the server could not understand the request the HTTP Request operation sent because its syntax was invalid (HTTP 400). Log the outgoing request, compare it with what the server expects, and correct the body, headers or parameters.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer