> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Oauth2 authentication

> Used to make for HTTP requests that require OAuth 2 authentication.

Adds OAuth 2 authentication to an HTTP API connection. Pick the OAuth token you have already set up, and every request the connection sends carries that token in an `Authorization: Bearer <token>` header. If a request comes back rejected because the token has expired, this feature automatically fetches a fresh token and tries the request once more, so you do not have to manage refreshes yourself.

This documentation describes: [Schema](/schemas/http-authentication-configurator/oauth2-bearer)

## Fields

**Token**

Required

The OAuth token used to authenticate. You select an OAuth token reference you have already configured; it holds the credentials and the rules for fetching and refreshing the token from your provider.

See the [oauth-token-reference](/references/oauth-token-reference) reference.

**Header**

Optional

The name of the HTTP header the token is placed in. Leave it empty to use the standard `Authorization` header. Set a different name only when the API you are calling expects the token somewhere else.

**Header Content**

Optional

The template for the header value. Use `{token}` where the token should go; it is replaced with the live token value. Leave it empty to use the standard `Bearer {token}`, which produces a value like `Bearer your-access-token`. Change it only when the API expects a different prefix or format.

## Sample data

This feature adds authentication to a live HTTP connection rather than transforming data, so there is no before/after to show. A typical configuration looks like this:

| Field | Value |
| - | - |
| Token | A configured OAuth token reference |
| Header | (left empty, so `Authorization` is used) |
| Header Content | (left empty, so `Bearer {token}` is used) |

With these settings, every request sent over the connection includes a header such as `Authorization: Bearer your-access-token`.

```json Configuration theme={null}
{
  "prototype": "oauth2-bearer",
  "parameters": {
    "token": {
      "prototype": "oauth-token-reference",
      "parameters": {}
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.