MuleSoft · OAuth 2.0 Access Token Enforcement Using Mule OAuth Provider policy

400 Invalid token

Short answer

An API protected by the OAuth 2.0 Access Token Enforcement Using Mule OAuth Provider policy returns 400 when the access token is invalid. Request a new token from the provider and send that one.

VerifiedLast verified

01Error text

MuleSoft error
400 - Invalid token

02Likely causes

  • The access token sent with the request is invalid.

03How to fix it

  1. Obtain a new access token from the Mule OAuth provider.
  2. Check the Scopes and Scope Validation Criteria settings in the policy against the scopes of the token.
  3. Repeat the request with the new token.

iNotes

The same policy returns 401 for "Unauthorized access or error when connecting to the authorization server" and 500 for "Bad response from authorization server, or WSDL SOAP fault error." If the validation endpoint rejects the policy's requests, the docs say to check that the URL is reachable from the machine running the policy and that the endpoint needs no authentication.

04Official documentation

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

The iPaaS Brief

Subscribe to The iPaaS Brief.

The iPaaS newsletter for the people who run integrations. From iPaaS Group.

Free. You finish on theipaasbrief.com and confirm by email.