---
schema_version: "1"
id: 701817698cd5ba463be4dadec53edfadc85dc0fda2b78c294f9fc84ae5389132
title: "Basic Authentication: Simple Policy"
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/latest/policies-included-basic-auth-simple.md
canonical_url: https://docs.mulesoft.com/gateway/latest/policies-included-basic-auth-simple
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b4a19f96638f9ec9b8f64371b1ca179587f1e59dd05b5033aaef2177b005e563
description: MuleSoft Documentation Site
release: "1.14"
latest: true
---
---
product: Omni Gateway
version: 1.14
is-latest-version: true
keywords: basic authentication, api gateway, flex gateway, gateway, policy
---

# Basic Authentication: Simple Policy

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

<table><colgroup><col> <col></colgroup><tbody><tr><td><p><strong>Policy Name</strong></p></td><td><p>Basic Authentication: Simple</p></td></tr><tr><td><p><strong>Summary</strong></p></td><td><p>Allows access based on the basic authorization mechanism, with a single user-password</p></td></tr><tr><td><p><strong>Category</strong></p></td><td><p>Security</p></td></tr><tr><td><p><strong>First Omni Gateway version available</strong></p></td><td><p>v1.0.0</p></td></tr><tr><td><p><strong>Release Notes</strong></p></td><td><p><a href="https://docs.mulesoft.com/release-notes/gateway/policies/basic-auth-simple-release-notes">Basic Authentication: Simple</a></p></td></tr><tr><td><p><strong>Returned Status Codes</strong></p></td><td><p>400 - Unauthorized or invalid client application credentials in WSDL API using SOAP 1.2</p></td></tr><tr><td></td><td><p>401 - Unauthorized or invalid client application credentials in HTTP or RAML APIs</p></td></tr><tr><td></td><td><p>500 - Unauthorized or invalid client application credentials in WSDL API using SOAP 1.1</p></td></tr></tbody></table>

## Summary

The Basic Authentication: Simple policy protects an API by forcing applications to provide a
username and password when making requests.

The policy follows [basic HTTP authentication standards](https://tools.ietf.org/html/rfc7617).

When an error is encountered, the policy returns an "WWW-Authenticate" HTTP header field.

## Configuring Policy Parameters

### Omni Gateway Local Mode

When you apply the policy via declarative configuration files, Refer to the following policy
definition and table of parameters:

\- policyRef: name: http-basic-authentication-flex config: username: <string> // REQUIRED password:
<string> // REQUIRED

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Parameter</th><th>Required or Optional</th><th>Default Value</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><code>username</code></p></div></div></td><td><div><div><p>Required</p></div></div></td><td><div><div><p>N/A</p></div></div></td><td><div><div><p>A base-64 encoded string</p></div></div></td></tr><tr><td><div><div><p><code>password</code></p></div></div></td><td><div><div><p>Required</p></div></div></td><td><div><div><p>N/A</p></div></div></td><td><div><div><p>A base-64 encoded string</p></div></div></td></tr></tbody></table>

#### Resource Configuration Example

\- policyRef: name: http-basic-authentication-flex config: username: chris password: admin

### Omni Gateway Connected Mode

When you apply the Basic Authentication: Simple 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 -n '<Client Id>:<Client Secret>' | base64`
