Join our Newsletter — 33% off our NHI Course
Home› Glossary› Authentication, Authorisation & Trust› x-forwarded-access-token
Authentication, Authorisation & Trust

x-forwarded-access-token

← Back to Glossary
By NHI Mgmt Group Updated October 28, 2026 Domain: Authentication, Authorisation & Trust

x-forwarded-access-token is a non-standard HTTP header name used by some proxy or gateway setups to pass an access token to an upstream service. It usually signals delegated authentication context between components, and the token should be treated as a secret because any downstream service that receives it can use it for bearer access.

What the header actually means in practice

x-forwarded-access-token is best understood as an implementation detail of delegated access propagation, not as a standard protocol feature. Its presence usually means a proxy, gateway, or edge component is passing a bearer credential upstream so the next service can act with the caller’s authorization context.

Because the value is an access token, the security model is the same as for any other bearer secret: possession is enough to use it. That makes the header risky if it is logged, forwarded too widely, cached, or exposed to components that do not need it.

Why proxies and gateways use it

Teams adopt headers like this when one service needs to call another on behalf of a user or frontend session. The proxy terminates the original request, preserves the delegated access context, and hands the upstream service a token it can present to downstream APIs without reauthenticating the user.

This pattern is common in service-to-service architectures, federated SaaS integrations, and on-behalf-of flows. It can reduce reauthentication friction, but it also increases the number of places where a live token exists and therefore increases the blast radius if one component is compromised.

The design only works safely when every hop understands token scope, audience, and expiry. If the header is copied into unrelated requests, or if a downstream service treats it as an all-purpose credential, the delegation boundary disappears.

Security properties and failure modes

The main security property is that the token should remain narrowly scoped to the intended resource and should not be treated as a general-purpose secret. The main failure mode is token leakage through headers, traces, error reports, reverse proxies, or application logs.

Another common failure mode is confused-deputy behavior, where a service receives the token and uses it beyond the intended user or workload context. That can create unintended privilege extension, replay opportunities, or access to systems that were never meant to see the original credential.

For this reason, organizations should treat any header carrying delegated access material as sensitive transport metadata, not as harmless routing context. The name may be custom, but the risk is the same as any bearer token crossing trust boundaries.

How to handle it safely in architecture and operations

If you use a header like this, define exactly which proxy tiers may inject it, which upstream services may accept it, and where it must be stripped before forwarding. The safest pattern is to keep the token audience-restricted, short-lived, and visible only to components that truly need delegated access.

Use explicit controls for logging, header forwarding, and request tracing so the token is never written to debug output or observability pipelines in cleartext. When possible, prefer sender-constrained or token-exchange patterns over free-floating bearer propagation, because they reduce replay value if the header is captured.

Document whether the header is part of an on-behalf-of design, a gateway translation layer, or a temporary compatibility shim. Ambiguity here is operational risk: if teams do not know whether the token is authoritative, they will eventually over-share, over-log, or over-trust it.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageBearer access tokens in forwarded headers are secrets that can leak through proxies and logs.
NHI-04 — Insecure AuthenticationPassing an access token through intermediaries affects how authentication material is accepted and validated.
NHI-07 — Long-Lived SecretsForwarded bearer tokens become higher risk when they remain valid for extended periods.
Recommendation — Prevent token exposure in headers, logs, and traces, and redact any propagated bearer material. Verify token audience, expiry, and acceptance rules before trusting forwarded authentication material. Prefer short-lived tokens and rotate or revoke credentials that can traverse proxy chains.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementAccess tokens are authenticators whose lifecycle and protection must be managed.
AC-6 — Least PrivilegeDelegated access carried in the header should be limited to the minimum necessary privilege.
Recommendation — Manage token issuance, storage, rotation, revocation, and reuse restrictions as authenticators. Limit token scopes and downstream permissions to the minimum access needed for the request.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 28, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org