> ## 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.

# Bearer token authentication

> Use a stored or static token in the HTTP Authentication header.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Adds a bearer token to a connection. Every request is sent with an `Authorization: Bearer <token>` header, which is how most modern APIs accept an access token. You can either type a fixed token yourself or have Alumio read the latest token from a storage, which is handy when another part of your integration refreshes the token over time.

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

## Fields

<FormField property="tokenType" label="Token type" required>
  Where the token comes from. Choose **Static token** to type a fixed value yourself, or **From storage** to read the current token from a storage by key. Defaults to a static token.
</FormField>

### Static token

<FormField property="token" label="Token" required>
  The token value, without the `Bearer` prefix (Alumio adds that for you). You can store the value in an environment variable and reference it here so the secret is not saved in the connection. Shown when the token type is **Static token**.
</FormField>

### From storage

<FormField property="storage" label="Storage" required diType="storage">
  The storage that holds the token. Pick an existing storage or configure one inline. Shown when the token type is **From storage**.
</FormField>

<FormField property="storageKey" label="Storage key" required>
  The key under which the token is saved in the chosen storage. Alumio reads the value at this key for each request, so a freshly refreshed token is always used. Shown when the token type is **From storage**.
</FormField>

## Sample data

This feature configures a connection rather than transforming data, so there is no before/after to show. A static-token setup looks like this:

| Field      | Value               |
| ---------- | ------------------- |
| Token type | `static`            |
| Token      | `your-access-token` |

```json Configuration theme={null}
{
  "prototype": "bearer",
  "parameters": {
    "tokenType": "static",
    "token": "your-access-token"
  }
}
```
