MuleSoft · Client ID Enforcement policy
401 Unauthorized or invalid client application credentials
An 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.
VerifiedLast verified
01Error text
401 - Unauthorized or invalid client application credentials02Likely causes
- The client application credentials are invalid or unauthorized.
- An approved contract must exist between the client application and the API.
- Every request must carry credentials that match the way the policy is configured.
03How to fix it
- Confirm the client application has an approved contract for this API instance.
- Check how the policy expects credentials. The
WWW-Authenticateresponse header isClient-ID-Enforcementin custom mode andBasic realm="mule-realm"in Basic Auth mode. - Send the client ID and secret in the place the policy configuration names, with the values from that client application.
- Repeat the request.
iNotes
The same policy returns 500 - Bad response from authorization server, or WSDL SOAP Fault error. SOAP APIs return a SOAP error.
04Official documentation
→Related errors
- 429 Quota exceededAn API protected by the Rate Limiting policy returns 429 Quota exceeded when the request quota for the current time window is used up. Requests are blocked until the window finishes, so wait for the window to reset or raise the limit in the policy.
- HTTP:UNAUTHORIZEDHTTP:UNAUTHORIZED means the server rejected the HTTP Request operation because authentication failed or was not provided (HTTP 401). Send the credentials the server expects, and handle the error type if a rejected call is something the flow should survive.
- HTTP:BASIC_AUTHENTICATIONHTTP:BASIC_AUTHENTICATION means a request did not carry basic authentication, or carried the wrong credentials. Send a valid basic authentication header with the request.
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