Basic Authentication: Simple Policy

Policy Name

Basic Authentication: Simple

Summary

Allows access based on the basic authorization mechanism, with a single user-password

Category

Security

First Mule version available

4.0.0

Returned Status Codes

400 - Unauthorized or invalid client application credentials in WSDL API using SOAP 1.2

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

500 - Unauthorized or invalid client application credentials in WSDL API using SOAP 1.1

The Simple Authentication policy protects an API by forcing applications to provide a username and password when making requests. This policy is available only in Mule 4 or later.

When an error is encountered, the policy returns an "WWW-Authenticate" HTTP header field using the following format:`WWW-Authenticate: Basic realm="mule-realm"`.

Creating Requests for APIs With Basic Authentication Policies

When you apply the Simple Authentication policy to an API, a request to that API must contain the following header:

Authorization: Basic <username:password>

The username:password value must be a base64-encoded string. For example on a Mac OS X or Linux system, the username and password requirement is implemented as:

echo '<Client Id>:<Client Secret>' | base64

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub