|
| 1 | +--- |
| 2 | +id: bearer-token-format |
| 3 | +title: Bearer Token Format |
| 4 | +description: | |
| 5 | + Bearer token format controls how HTTP bearer token authentication is handled. |
| 6 | +keywords: |
| 7 | + - reference |
| 8 | + - Bearer Token Format |
| 9 | +pagination_prev: null |
| 10 | +pagination_next: null |
| 11 | +toc_max_heading_level: 2 |
| 12 | +--- |
| 13 | + |
| 14 | +import Tabs from '@theme/Tabs'; |
| 15 | +import TabItem from '@theme/TabItem'; |
| 16 | + |
| 17 | +# Bearer Token Format |
| 18 | + |
| 19 | +## Summary |
| 20 | + |
| 21 | +**Bearer Token Format** controls how HTTP bearer token authentication is handled. There are 3 possible options: `default`, `idp_access_token` and `idp_identity_token`. |
| 22 | + |
| 23 | +HTTP bearer tokens are tokens stored in the `Authorization` header prefixed by `Bearer `: |
| 24 | + |
| 25 | +```text |
| 26 | +GET / HTTP/1.1 |
| 27 | +Authorization: Bearer Token |
| 28 | +``` |
| 29 | + |
| 30 | +Pomerium's `default` behavior is to pass bearer tokens to upstream applications without interpreting them. Pomerium also supports creating sessions from tokens issued by an identity provider without needing to initiate an interactive login. If the `idp_access_token` option is used, then the bearer token will be interpreted as an IdP-issued access token. If the `idp_identity_token` option is used, then the bearer token will be interpreted as an IdP-issued identity token. |
| 31 | + |
| 32 | +Currently only [Microsoft Entra](../../integrations/user-identity/azure) is supported with this option. |
| 33 | + |
| 34 | +This option can also be configured at the route-level. |
| 35 | + |
| 36 | +## Additional Headers |
| 37 | + |
| 38 | +Pomerium also always supports passing IdP access and identity tokens via the following headers (replacing `<TOKEN>` with the issued token): |
| 39 | + |
| 40 | +- `X-Pomerium-IDP-Access-Token: <TOKEN>` |
| 41 | +- `Authorization: Pomerium-IDP-Access-Token <TOKEN>` |
| 42 | +- `Authorization: Bearer Pomerium-IDP-Access-Token-<TOKEN>` |
| 43 | +- `X-Pomerium-IDP-Identity-Token: <TOKEN>` |
| 44 | +- `Authorization: Pomerium-IDP-Identity-Token <TOKEN>` |
| 45 | +- `Authorization: Bearer Pomerium-IDP-Identity-Token-<TOKEN>` |
| 46 | + |
| 47 | +## How to Configure |
| 48 | + |
| 49 | +<Tabs> |
| 50 | +<TabItem value="Core" label="Core"> |
| 51 | + |
| 52 | +| **Config file keys** | **Environment variables** | **Type** | **Default** | |
| 53 | +| :-------------------- | :------------------------ | :------- | :---------- | |
| 54 | +| `bearer_token_format` | `BEARER_TOKEN_FORMAT` | `string` | `default` | |
| 55 | + |
| 56 | +### Examples |
| 57 | + |
| 58 | +```yaml |
| 59 | +bearer_token_format: idp_access_token |
| 60 | +``` |
| 61 | +
|
| 62 | +```bash |
| 63 | +BEARER_TOKEN_FORMAT=idp_access_token |
| 64 | +``` |
| 65 | + |
| 66 | +### Options |
| 67 | + |
| 68 | +- `default` |
| 69 | +- `idp_access_token` |
| 70 | +- `idp_identity_token` |
| 71 | + |
| 72 | +</TabItem> |
| 73 | +<TabItem value="Enterprise" label="Enterprise"> |
| 74 | + |
| 75 | +Set **Bearer Token Format** under **Proxy** settings in the Console: |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +</TabItem> |
| 80 | +<TabItem value="Kubernetes" label="Kubernetes"> |
| 81 | + |
| 82 | +```yaml |
| 83 | +bearerTokenFormat: idp_access_token |
| 84 | +``` |
| 85 | +
|
| 86 | +See [Kubernetes - Global Configuration](/docs/deploy/k8s/configure) for more information. |
| 87 | +
|
| 88 | +</TabItem> |
| 89 | +</Tabs> |
0 commit comments