OAuth Broker
The OAuth Broker is a standalone, security-focused service that centralizes OAuth/OIDC flows across vendors (e.g., GitHub, Asana, Ramp, Datadog). It is deployed as shared infrastructure (e.g.,oauth.runlayer.com) to provide a single, vendor-approved redirect URI and standardized flows, removing the need to register separate OAuth apps and redirect URIs per customer deployment.
Why an OAuth Broker
- Allow-list problem: Many vendors require pre-approved redirect URIs. Self-hosted or per-tenant deployments often have unique domains that are not allow-listed, causing OAuth failures. The broker solves this by using a pre-registered, vendor-allow-listed domain.
- Operational simplicity: Centralizes vendor app registrations, scopes, and callbacks—no more per-deployment manual configuration.
- Security: Uses PKCE for the MCP↔Broker hop and for the Broker↔Vendor hop when the vendor supports it.
- Consistency: Normalizes provider differences and offers a single integration surface for the platform.
How It Works (High Level)
The broker sits between Runlayer (MCP) and vendors, handling the user-facing authorization and the token exchange. Runlayer initiates the flow via the broker; the broker redirects to the vendor; upon completion, the broker exchanges the authorization code and returns tokens back to Runlayer.PKCE-Protected Flow
The client-to-broker leg always uses PKCE. A second verifier protects the upstream leg when the vendor supports PKCE:- PKCE #1: MCP ↔ OAuth Broker
- PKCE #2, when supported: OAuth Broker ↔ Vendor
Dynamic Client Registration (DCR)
The broker can perform Dynamic Client Registration (DCR) on behalf of clients for vendors that support it (like Ramp MCP). This simplifies onboarding by automatically registering OAuth applications with the vendor: For vendors that support DCR, the broker registers an OAuth client with the vendor on your behalf during onboarding, so you do not need to create a vendor OAuth app manually. The resulting vendor credentials are returned to your Runlayer deployment, which stores them encrypted as its BYOC configuration and uses them for subsequent authorization flows. For vendors without DCR, credentials come from your BYOC configuration. See How Runlayer Stores Credentials for how these credentials are protected at rest.Security Considerations
- State JWT: The broker validates a signed state to bind requests to vendors and sessions.
- PKCE: Protects the client-to-broker hop and the upstream hop when the vendor supports it.
- Token handling: Tokens are exchanged at the broker and returned to Runlayer. Production deployments can enable token encryption at rest and in transit.
- Refresh and revocation: The broker exposes standardized refresh and revocation paths when acting on behalf of Runlayer.
- OIDC validation: If OIDC is used, the broker validates ID tokens against provider JWKS.
Integration in Runlayer
- In the server configuration UI, enable “Use OAuth Broker” for vendors that support it.
- Ensure your deployment exposes the appropriate callback endpoint expected by the broker (the platform will compute this automatically when the broker URL is configured).
- For vendors requiring manual approval/whitelisting, leverage the broker’s pre-registered redirect URI.
Manual OAuth Endpoint Overrides
Some OAuth providers use non-standard or tenant-specific endpoints that auto-discovery cannot resolve. When configuring an OAuth-authenticated server in manual mode, you can override the authorization and token URLs:- Authorization URL — Override the OAuth authorization endpoint (e.g.,
https://login.example.com/{TENANT}/oauth2/v2.0/authorize) - Token URL — Override the OAuth token endpoint (e.g.,
https://login.example.com/{TENANT}/oauth2/v2.0/token)
{placeholder} syntax for dynamic values like tenant IDs.
Vendor Scenarios
The OAuth Broker is shared Runlayer infrastructure atoauth.runlayer.com. On Runlayer-hosted deployments it is used by default. On self-hosted deployments you can use the same broker when VPC egress allows oauth.runlayer.com (set oauth_broker_url accordingly); otherwise fall back to per-vendor setup — see Self-hosted deployments.
Self-hosted deployments
The OAuth Broker runs as shared Runlayer infrastructure (oauth.runlayer.com). Self-hosted deployments can call it when outbound HTTPS to that host is allowed — see Self-Hosted Egress Requirements. Without broker egress, each vendor falls back to its own OAuth setup:
- GitHub — register your own OAuth app as a Pre-registered Client. See Adding GitHub MCP server.
- Slack connector — register your own Slack app as a Pre-registered Client. See Slack.
- Other vendors — self-hosted OAuth support varies. Contact Runlayer before enabling them on a self-hosted deployment.
oauth_broker_url is separate from WorkOS (api.workos.com / AuthKit), which handles SSO and SCIM.
OAuth inside a private VPC
Per-vendor OAuth does not require your deployment to be internet-facing. With a pre-registered client, the callback URL you register with the vendor (https://<your-tenant-url>/oauth/callback/) is served by your own deployment, and the vendor redirects to it via the user’s browser — the vendor never connects to it directly. So OAuth works with a VPC-internal tenant URL as long as:
- users’ browsers can reach the deployment (e.g., corporate network or VPN) and the vendor’s authorization page, and
- the deployment has outbound HTTPS to the vendor’s token endpoint for the code exchange.
oauth.runlayer.com (see Self-Hosted Egress Requirements).
Vendor Setup Instructions
GitHub
GitHub works automatically through the OAuth Broker with no setup required. The broker handles all OAuth flows transparently.Asana
Asana works automatically through the OAuth Broker with no setup required. The broker handles all OAuth flows transparently.Ramp
Ramp works automatically through the OAuth Broker with no configuration required. The broker handles all OAuth flows transparently.Guru
Guru works automatically through the OAuth Broker with no configuration required. The broker handles all OAuth flows transparently, including Dynamic Client Registration (DCR).Box
Box works automatically through the OAuth Broker with no setup required. The broker handles all OAuth flows transparently. App-level permissions are configured on the Runlayer OAuth app in the Box Admin Console, not via OAuth scopes.Datadog
To use Datadog with the OAuth Broker:- Request organization access via the Datadog MCP Server preview form
- Once your organization is approved, Datadog works automatically through the broker
Microsoft Agent 365
Microsoft Agent 365 works automatically through the OAuth Broker using a shared multitenant Azure AD application. No Azure AD app registration is required. Users just need to:- Enable Agent 365 access in the Microsoft Admin Center
- Configure their Power Platform environment ID in the server URL
FAQ
Do we proxy vendor API calls through the broker?
Do we proxy vendor API calls through the broker?
What if the vendor changes their OAuth endpoints?
What if the vendor changes their OAuth endpoints?
How are tokens protected?
How are tokens protected?
How does Runlayer store the OAuth tokens I grant to connectors?
How does Runlayer store the OAuth tokens I grant to connectors?
Does every tenant need its own vendor app?
Does every tenant need its own vendor app?
Is the broker mandatory?
Is the broker mandatory?
How does Initial Access Token (IAT) fit in?
How does Initial Access Token (IAT) fit in?
Which vendors are supported?
Which vendors are supported?
What is BYOC and when should I use it?
What is BYOC and when should I use it?
Do BYOC credentials work with all vendors?
Do BYOC credentials work with all vendors?
How secure is BYOC?
How secure is BYOC?
What happens if my BYOC credentials expire or are revoked?
What happens if my BYOC credentials expire or are revoked?
What is the redirect URI allow-listing problem and how does the broker solve it?
What is the redirect URI allow-listing problem and how does the broker solve it?
https://customer1.example.com, https://customer2.example.com) or self-hosted deployments use custom domains that can’t be predicted in advance—vendors reject authorization requests if the redirect URI isn’t pre-allow-listed. For authorization flows that traverse the OAuth Broker, it provides a single, centralized redirect URI (https://oauth.runlayer.com/v1/callback) and securely returns tokens to the originating Runlayer deployment. Brokered BYOC apps register this broker URL. Customer-owned Slack apps instead use Pre-registered Client and must register the deployment-specific callback described in the Slack setup guide.What is DCR (Dynamic Client Registration) and how does the broker help?
What is DCR (Dynamic Client Registration) and how does the broker help?
client_id, client_secret, etc.) to the caller. The caller is then responsible for securely storing and using these vendor-specific credentials (often as BYOC configuration) in subsequent flows. This design simplifies client integration while enabling support for vendors that require DCR without forcing the broker to persist vendor credentials.