External authentication is available on Developer and Enterprise.
The two credentials serve different trust boundaries:
For the first boundary, see Authentication. Server
roles and capability policies are covered in
Authorization.
Authentication modes
Choose the mode based on whether the downstream provider requires a credential and who owns that credential.
No authentication applies only to external servers. Horizon still authenticates
and authorizes the caller at the Horizon endpoint, but it does not forward the
caller’s Horizon credential to the remote MCP server.
OAuth and per-user API keys preserve the downstream user’s identity and
permissions. A shared API key makes every forwarded request act as the same
upstream principal, even though Horizon continues to identify and authorize the
original caller at its own gateway.
OAuth setup
Horizon starts OAuth setup with the provider or remote MCP URL. It follows protected-resource and authorization-server metadata to locate the OAuth endpoints.
When manual setup is required, register Horizon’s callback URL with the
provider, then enter the resulting client details in Horizon. For the hosted
Horizon control plane, use
https://horizon.prefect.io/oauth/external/callback.
After the configuration is saved, each user completes the provider flow for
their own Horizon identity. External-server users can select Authorize from
the server’s Connection page. Hosted-server users authorize when connecting
an interactive MCP client, as described in User authorization.
Horizon stores the resulting credential for that Horizon actor. The MCP client
never receives the provider token.
API-key setup
An API-key auth source can send up to ten headers. Configure each header name, its value, and an optional encrypted credential in one editor. This supports providers that require an API key with an organization, tenant, or profile identifier. A header value can contain zero or one{token} placeholder:
New headers default to
{token} because a provider can treat an identifier as sensitive even when it is not called a secret.
Use a literal value only when users who can view the auth configuration can also view that value.
Horizon never displays an encrypted credential after it is saved.
For example, a provider can require two independent protected values:
{token} value entered during setup belongs to the current user.
Each additional user enters their own values for these headers.
Literal values are part of the auth source configuration and apply to every user.
With a shared API key, a server administrator saves one credential set for the organization.
External servers
An external server always authenticates the client at the Horizon-served endpoint. Horizon then uses the configured external credential, or no credential for a public remote MCP server, when it forwards the request.1
Choose a connector
From Servers, start creating an external server. Select a
global connector, or add and select an
organization connector for the remote MCP endpoint.
2
Choose authentication
Enter the connector name, then select No authentication,
OAuth (per user), Key (per user), or Key (shared).
Select no authentication only when the remote server accepts anonymous
requests.
3
Configure the provider
For OAuth, review the discovered registration or enter a pre-registered
client. For an API key, add every required header and enter each encrypted
value in the same form. Horizon requires every token-backed value before it
creates an external server.
4
Authorize OAuth
If you selected OAuth, complete Authorize with OAuth.
5
Create the connector
Review the remote endpoint and authentication mode, then select
Create Connector. For a per-user or shared key, Horizon saves the
credential values when connector creation succeeds. Horizon sends anonymous
requests when you selected no authentication.
Delegated authorization
Hosted delegated authorization applies the same external auth configuration to a hosted server. It is useful when hosted server code calls an upstream API as the signed-in user and already expects that provider’s token in an HTTP request header. The setup flow and runtime flow form a double handshake:- The user authorizes Horizon with the upstream provider, or stores a personal token in Horizon.
- The MCP client authenticates to Horizon. The trusted gateway identifies the Horizon user, exchanges that identity for the saved downstream credential, and injects the credential before invoking hosted server code.
Authorization header. It then injects every downstream header configured by
the auth source. For the default OAuth configuration, hosted server code
receives:
Configure delegation
Delegated authorization requires Horizon Authentication to remain enabled for the hosted server. Linking and unlinking an auth source updates serving configuration without rebuilding or redeploying the hosted server. The Access and Authentication page requires server write access, so these configuration steps are for a server administrator.1
Open authentication
Open the hosted server, then select Access and
Authentication. Confirm that Horizon Authentication is
enabled.
2
Link an auth source
In Delegated authentication, select Link auth source. Give the
source a recognizable name and choose OAuth, per-user API key, or shared API
key.
3
Configure credentials
Complete OAuth discovery and registration, or configure all API-key headers
and available credential values. Select Link auth source to save the
configuration, attach it to the hosted server, and save the values you
entered.
4
Add missing credentials
If you omitted credential values, select Authorize for OAuth,
Add token for a per-user key, or Add key for a shared key.
OAuth and per-user credentials belong to your signed-in Horizon user. Shared
credentials belong to the organization.
5
Test the exchange
Call the hosted server through its Horizon endpoint as an authorized user.
Confirm that the hosted handler receives the configured downstream headers
and that its upstream call succeeds.
User authorization
OAuth and per-user API-key auth sources require every caller to save their own downstream credential. Users with server access do not need server write access to complete this authorization. An interactive MCP client starts the self-authorization flow when it first connects to the hosted server. After Horizon sign-in, the Horizon is requesting access page lists the linked auth source. Select Needs Access to complete OAuth or Needs credentials to save personal header values. Horizon then completes the client connection. A client that uses a personal Horizon API key does not open this browser flow. Before connecting that client, sign in to Horizon in a browser and open:<server-slug> with the hostname prefix from the hosted server URL. For
example, the slug in https://weather-mcp.fastmcp.app/mcp is weather-mcp.
Authorize the provider or add the personal credentials, then retry the client. This
self-authorization page requires server access, while auth-source configuration
remains restricted to server writers.
Service-account keys cannot use delegated authorization. Authorizing in the
browser saves the downstream credential for the signed-in user, not the service
account. Automation that authenticates with a service-account key must provide
its upstream credential through the hosted server itself, such as with an
environment variable, until service-account delegated
authorization is supported.
For user actors, a shared downstream API key needs no per-user authorization.
Horizon uses the organization-wide credential configured by the server
administrator.
Current boundaries
Hosted delegated authorization has the following first-version boundaries:
Fail-open behavior preserves hosted server availability when a credential is
missing, expired, revoked, or temporarily unavailable. It does not bypass the
initial Horizon authentication or server access checks, which happen before the
exchange. The hosted server will not receive a usable downstream credential, so
its upstream call will normally fail authentication unless the server has an
independent fallback.
Horizon encrypts OAuth client secrets, OAuth tokens, and API-key header values at rest. It
keeps credential material out of normal responses, logs, and traces. For the
storage and encryption boundary, see
Data protection.
Related docs
Authentication
Understand how callers authenticate to Horizon before external exchange.
External servers
Register and operate remote MCP servers through the Horizon gateway.
Hosted servers
Build and run MCP servers that can use delegated authorization.
Data protection
Review how Horizon protects credentials and other sensitive values.