Files
docs-v2/content/docs/manage/access-control/forwarded-headers.mdx
T

75 lines
4.2 KiB
Plaintext

---
title: "Forwarded Headers"
description: "Learn how Pangolin forwards user identity information to your backend applications through HTTP headers"
---
Pangolin can forward user identity information to your backend applications through custom HTTP headers. This allows your applications to receive user details directly from the request headers, enabling integration with Pangolin's authentication system. The same headers apply to [public HTTP/HTTPS resources](/manage/resources/public/http-https), [private HTTP/HTTPS resources](/manage/resources/private/private-http), and [AI Gateway](/manage/ai/overview) resources. For AI Gateway specifics, see [Identity Headers](/manage/ai/providers/configuration#identity-headers).
<Info>
Forwarded headers are only sent when Pangolin knows who the caller is — for example an authenticated public-resource session, or a connected [Pangolin client](/manage/clients/platforms) on a private HTTP resource that maps to a user.
</Info>
## Supported Headers
Pangolin forwards the following headers to your backend when user identity is available:
| Header | Description | Example |
|--------|-------------|---------|
| `Remote-User` | Unique username or user ID | `user_123` |
| `Remote-Email` | User's email address | `john.doe@example.com` |
| `Remote-Name` | User's full name | `John Doe` |
| `Remote-Role` | User's role or group membership | `admin` |
## Public Resources
On [public HTTP/HTTPS resources](/manage/resources/public/http-https), headers depend on the authentication method.
### Headers Available
These authentication methods provide user identity information and will include the forwarded headers:
<CardGroup cols={2}>
<Card title="Single Sign-On (SSO)" icon="users">
Full user identity information including username, email, and name.
</Card>
<Card title="Email-based One Time Passcode (OTP)" icon="envelope">
Only `Remote-Email` is provided, set to the whitelisted address the visitor authenticated with. `Remote-User`, `Remote-Name`, and `Remote-Role` are not available since there is no associated user account.
</Card>
<Card title="Shareable Links" icon="link">
Only available if the link was created with an associated user account. In that case, full user identity information is forwarded, the same as SSO. Links created without an associated user do not provide identity headers.
</Card>
</CardGroup>
### Headers Not Available
These authentication methods do not provide user identity information:
<CardGroup cols={2}>
<Card title="PIN Code" icon="hashtag">
No user identity - only access control.
</Card>
<Card title="Password" icon="lock">
No user identity - only access control.
</Card>
</CardGroup>
## Private HTTP
On [private HTTP/HTTPS resources](/manage/resources/private/private-http), identity comes from the connected [Pangolin client](/manage/clients/platforms), not from a public login page. When that client maps to a user, Pangolin forwards the same `Remote-User`, `Remote-Email`, `Remote-Name`, and `Remote-Role` headers to the upstream app. Access still comes from [private resource grants](/manage/resources/private/authentication) (users, roles, and machines); the headers carry the identity once the client is already authorized.
## Client Certificate (mTLS)
When [mTLS](/manage/access-control/mtls) is enabled on a public resource, verified client certificate details are forwarded in `X-Forwarded-Tls-Client-Cert-Info` (subject, issuer, serial number, validity, and SANs). That header is independent of the `Remote-*` identity headers above and is available whenever the TLS handshake succeeds with a trusted client certificate.
## AI Gateway
[AI Gateway](/manage/ai/overview) resources forward the same `Remote-User`, `Remote-Email`, `Remote-Name`, and `Remote-Role` headers to the upstream model API when Pangolin knows the user:
- A public resource called with an [identity key](/manage/ai/virtual-api-keys#identity-keys)
- A public resource called with a [manual key](/manage/ai/virtual-api-keys#manual-keys) attributed to a user
- A private AI Gateway resource called from a connected [Pangolin client](/manage/clients/platforms)
An unattributed manual key authenticates without sending these headers. Details are in [Identity Headers](/manage/ai/providers/configuration#identity-headers).