Skip to content

Configure Embedded user authorization: An MCP authorization flow in which your application signs a user in through an OIDC Identity Provider and authorizes their access to one MCP server, with no Aembit page in the browser. The MCP Identity Gateway then uses that access on the user's behalf.Learn more in your Aembit Tenant: Aembit Tenants serve as isolated, dedicated environments within Aembit that provide complete separation of administrative domains and security configurations.Learn more when your application has its own UI, such as a portal or AI agent platform, so people can connect MCP Server: A server that implements the Model Context Protocol to provide tools, resources, or data to AI agents and MCP clients.Learn more(opens in new tab) without leaving it.

Copy an Aembit Client ID from an OIDC Identity Provider, create a Client-to-Gateway Policy: The Access Policy that validates which MCP client can connect to the MCP Identity Gateway and authenticates users through your Identity Provider. Also called left-side auth; you create one per MCP client and Gateway combination.Learn more for your application, and create a Gateway-to-Server Policy: The Access Policy that authorizes the MCP Identity Gateway to access an MCP server on behalf of authenticated users—the Gateway itself is the Client Workload. Also called right-side auth; each MCP server behind the Gateway needs its own.Learn more for each MCP server. For a full explanation of the flow, see Embedded user authorization.

  • An MCP Identity Gateway: A component that brokers MCP traffic between MCP clients and target MCP servers, validating authorization and presenting Aembit-managed credentials on each request.Learn more endpoint for your Aembit Tenant. See Request your MCP Identity Gateway endpoint.
  • An active OIDC 1.0 Identity Provider in your Aembit Tenant, whose ID token includes the person’s email address. See Create an OIDC 1.0 Identity Provider.
  • An OAuth public client in your application that uses the authorization code flow with PKCE (Proof Key for Code Exchange): An OAuth 2.0 extension that prevents authorization code interception attacks. The client creates a cryptographic challenge during the authorization request and proves possession of the original secret when exchanging the code for a token.Learn more(opens in new tab) and can add a custom parameter to the authorize request.

Copy the Aembit Client ID from your OIDC 1.0 Identity Provider in your Aembit Tenant’s administration settings. Your application sends it as client_id to identify itself to Aembit.

  1. Log into your Aembit Tenant.

  2. Click Administration in the left sidebar.

  3. Select Administration ☰ Identity Providers.

  4. Click your OIDC 1.0 Identity Provider to open it.

  5. On the Details tab, copy the Aembit Client ID.

    Aembit shows the Aembit Client ID only on a saved OIDC 1.0 Identity Provider, after Aembit Redirect URL.

Create the client-to-gateway Access Policy

Section titled “Create the client-to-gateway Access Policy”

Create the Client-to-Gateway Policy in the Access Policy builder, one card at a time, in the order of the following sections.

  1. In your Aembit Tenant, go to Access Policies and click + New.
  2. In the Name field, enter a name for the Access Policy.

Create a new Client Workload: Client Workloads represent AI agents, software applications, scripts, or automated processes that initiate access requests to Server Workloads. They can act on behalf of a user under blended identity or operate autonomously, as when one service calls another.Learn more that represents only your application. The Enforce SSO settings apply to every MCP client the Client Workload matches, so do not reuse a Client Workload that other MCP clients match.

  1. In the Client Workload card, click + Configure, and select the Add New tab.

  2. Under Client Identification, select Redirect URI, and enter your application’s callback URL as the Value.

    A value that ends in /* matches any path under it on the same scheme, host, and port. See Redirect URI.

  3. Under MCP Authorization Configuration, leave Enforce SSO on.

    With Enforce SSO off, the person does not sign in or consent at the MCP server, so your application gets no access to the MCP server for that person.

  4. In the Identity Provider list under Enforce SSO, keep only the Identity Provider whose Aembit Client ID your application uses.

    With more than one active Identity Provider in the list, Aembit stops the flow and returns the person’s browser to your application with an error.

  5. Click Save.

  1. In the Server Workload card, click + Configure.
  2. On the Select Existing tab, select the Server Workload: Server Workloads represent target services, APIs, databases, or applications that receive and respond to access requests from Client Workloads.Learn more that represents MCP Identity Gateway. If none exists, create one on the Add New tab as Server Workload describes.
  3. Note the Server Workload’s URL, such as https://<tenant-id>.mcpgateway.aembit.io/mcp. Your application sends this URL as resource.

When the resource your application sends does not match this Server Workload, Aembit stops the flow and returns the person’s browser to your application with an error.

In the Trust Provider card, select an existing Trust Provider: Trust Providers verify identity claims from a workload's runtime environment or an Identity Provider instead of relying on pre-shared secrets. They support workload attestation and user identity validation for blended identity.Learn more on the Select Existing tab, or create one as Trust Provider describes.

  1. In the Credential Provider card, click + Configure, and select the Add New tab.
  2. Set Credential Type to OIDC ID Token and Audience to the MCP Identity Gateway URL. Set the other fields as Credential Provider describes.
  3. To let your application refresh its access token, turn on Enable Refresh Token Support and set Absolute Token Lifetime.
  4. Click Save.

The access token your application gets at the end of the flow comes from this Credential Provider: Credential Providers obtain the specific access credentials—such as API keys, OAuth tokens, or temporary cloud credentials—that Client Workloads need to authenticate to Server Workloads.Learn more and lasts for its lifetime.

With an Aembit Access Token Credential Provider, the flow also completes. MCP Identity Gateway then rejects the access token, because its audience is not the MCP Identity Gateway URL. With an MCP User-Based Access Token Credential Provider, the token request fails with invalid_request.

  1. In the Access Policy status card, verify that each required component shows a green Configured status.
  2. In the header, click Save Policy & Activate.

Create a gateway-to-server Access Policy for each MCP server

Section titled “Create a gateway-to-server Access Policy for each MCP server”

Each MCP server your application authorizes people for needs a Gateway-to-Server Policy that meets the following requirements. Use an existing Gateway-to-Server Policy that meets them, or create one by following Create the gateway-to-server Access Policy.

  • The Server Workload must point to the same MCP server URL your application requests. For how Aembit compares the two, see MCP server URL rules.
  • Only one Gateway-to-Server Policy available to the person can match each MCP server. When more than one matches, Aembit stops the flow and returns the person’s browser to your application with an error.
  • The Access Policy must have exactly one active MCP User-Based Access Token Credential Provider and no active SSO Access Token Passthrough Credential Provider. MCP Enterprise Managed Access Token and OAuth 2.0 Authorization Code do not work with embedded user authorization.

Your application uses these values to build the authorize and token requests. Replace <tenant-id> with your Aembit Tenant ID and <stack> with your Aembit Tenant’s stack.

ValueWhere to find itRequest parameter
Aembit Client IDThe OIDC Identity Provider’s Details tabclient_id
Redirect URIThe Client Workload’s Redirect URI identifierredirect_uri
MCP Identity Gateway URLThe Server Workload in the Client-to-Gateway Policyresource
MCP server URLThe Server Workload in each Gateway-to-Server Policymcp_server_url
Authorize endpointhttps://<tenant-id>.id.<stack>.aembit.io/connect/authorizeNone
Token endpointhttps://<tenant-id>.id.<stack>.aembit.io/connect/tokenNone