MuleSoft · Basic Authentication: Simple policy

401 Unauthorized or invalid client application credentials (Basic Authentication: Simple)

Short answer

An API protected by the Basic Authentication: Simple policy returns 401 when the request has no valid Basic credentials. Send an Authorization: Basic header with the base64-encoded username:password that the policy is configured with.

VerifiedLast verified

01Error text

MuleSoft error
401 - Unauthorized or invalid client application credentials in HTTP or RAML APIs

02Likely causes

  • The request has no Authorization header, or its credentials do not match the user name and password set in the policy.

03How to fix it

  1. Build the header value by base64-encoding username:password, for example with echo -n '<user>:<password>' | base64.
  2. Send it as Authorization: Basic <encoded value>.
  3. Check the user name and password against the policy configuration in API Manager.

iNotes

On error the policy returns a WWW-Authenticate header. WSDL APIs get 400 (SOAP 1.2) or 500 (SOAP 1.1) for the same condition.

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.