Identity and authorization for user-delegated agents

Agents act for a signed-in user with access scoped to one service. Your existing OAuth server stays in place, and merchant credentials stay server-side, never with the agent.

Start the quickstart

Building needs an Evaluation Console account. Self-serve sign-up isn't confirmed for this release, so request evaluation access if you can't create one.

Behind the screenEvaluation hosts

Muse calls Northwind's MCP service and gets a 401 that names AIGW as the authorization server.

  1. mcp.northwind.example
    → POST /mcp tools/call reorder
    ← 401 resource_metadata names AIGW

Illustration with example values. Muse is Meta's personal agent; Northwind is a sample merchant.

Pick the part you're building

One OAuth flow for every AIGW-protected service

Your agent finds the authorization server from the 401, registers itself and runs authorization code with PKCE. There is no client to pre-register with each merchant and no merchant credential to store. You hold an AIGW token scoped to one Resource and one user.

  • Follow resource_metadata from the 401
  • Register with Dynamic Client Registration
  • Authorize with PKCE, exchange the code
Call the service with the AIGW tokenhttp
POST /mcp HTTP/1.1Host: mcp.example.comAuthorization: Bearer <AIGW access token>Content-Type: application/json{  "jsonrpc": "2.0",  "id": 1,  "method": "tools/list",  "params": {}}

Know who is behind every agent call

Not a shared API key

An API key says nothing about who asked. An AIGW token names one user and one approved agent, scoped to one Resource.

Not the user's real token

Handing your access token to an agent puts it in prompts and logs. The agent holds an AIGW token, and yours stays in AIGW's vault.

Not a rebuild of your IAM

Agent registration, consent and the token vault run in AIGW. Your OAuth server stays the source of truth for users and scopes.

Runs on your existing OAuth server

What stays the same

  • Your OAuth 2.0 or OpenID Connect server stays the source of truth for users and scopes.
  • Your backend API keeps accepting access tokens from your own server.
  • Agents use standard OAuth clients with Dynamic Client Registration (RFC 7591) and PKCE.

What you configure

  • Your authorization server trusts the AIGW Resource issuer and JWKS, gets a client for AIGW with signed JWT authentication, and defines the scopes AIGW requests.
  • You decide how AIGW users match your users: email, pre-linked accounts or your own provisioning.
  • Your MCP or UCP service returns a 401 with Protected Resource Metadata (RFC 9728) and redeems tokens with its Proxy token.

Verified in this release

  • Keycloak 26 with private_key_jwt (RFC 7523), with a step-by-step guide.
  • Other OAuth servers: the protocol contract is documented. Auth0 and Okta walkthroughs are not available yet.
  • RFC 8693 token exchange is unverified. client_secret_basic is not supported.
# 401 from the service points the agent to this document (RFC 9728)GET /.well-known/oauth-protected-resource HTTP/1.1Host: mcp.example.com{  "resource": "https://mcp.example.com",  "authorization_servers": ["https://api.aigw.eval.loginid.ai/<RESOURCE_ID>"]}

Evaluation environment hosts. The first four requests are standard OAuth. Redeem is AIGW's API.

Run the full flow in the Playground

Nine stages against a live Evaluation Resource, with the request, response and tokens shown at each one. Use it to learn the flow, then to test your own Resource's configuration.

  1. Probe
  2. Discover
  3. Config
  4. Register
  5. Authorize
  6. Token
  7. Proxy auth
  8. Redeem
  9. Resource call
The AIGW Playground on its first stage, Probe: the agent's request to the resource MCP server, its headers and JSON-RPC payload, with the flow stages listed on the left and a diagram of agent, resource MCP and AIGW on the right.

The agent never holds the merchant's token

AIGW gives the agent its own token. The merchant's access token stays in AIGW's vault and is released only to your service, server-side.

Read the diagram as text
  • 1 User to Agent: Prompt.
  • 2 Agent to UCP / MCP Proxy: Search product, without a token.
  • 2' UCP / MCP Proxy to Agent: Return 401 and resource_metadata.
  • 3 Agent to LID AIGW: Visit the URL dedicated to this merchant, with an HTTP signature.
  • 4 User to LID AIGW: Authenticate and authorize.
  • 5 LID AIGW to Merchant Token Exchange: Token exchange to get the merchant access token and refresh token.
  • 6 LID AIGW to LID Token Vault: Store the merchant access token and refresh token.
  • 7 LID AIGW to Agent Callback: Callback with access code.
  • 8 Agent Callback to LID Token Endpoint: Get LID access and refresh tokens.
  • 9 Agent Callback to Agent: Return tokens.
  • 10 Agent to UCP / MCP Proxy: Search product with the LID token.
  • 11 UCP / MCP Proxy to LID Token Vault: Get the merchant access token.
  • 12 UCP / MCP Proxy to Merchant Backend: Search with the merchant access token.
  • 13 LID Token Vault to Merchant Token Endpoint: Refresh if the access token expired.

AIGW architecture

AIGW architecture diagram. The user, the agent domain, the proxy domain, the LoginID (LID) domain and the merchant domain, connected by numbered steps 1 to 13. A text description of every step follows the image.

The agent holds an AIGW token

Scoped to one Resource and one user. The merchant API does not accept it.

Your service redeems the merchant token

Redemption needs the AIGW token plus the service's Proxy token from the same Project. A leaked agent token alone returns nothing.

The merchant trusts AIGW, not agents

The merchant's server verifies AIGW's signed assertions against its JWKS and issues nothing to agents directly.

How AIGW works

Six rules before you go to production

The short version of the best practices guide. The production checklist covers the rest: environments, logging, rate limits, rotation and revocation.

  • Start from the 401, not a hard-coded URL

    The 401 names the authorization server, so agents keep working when a Resource changes.

  • Ask for scopes at authorization, never at registration

    Each token carries only what the user approved.

  • Keep tokens out of the model

    Prompts and tool output end up in logs, traces and later turns.

  • Redeem the merchant token on the server

    An agent that can read it can call the merchant API directly, skipping your service's checks.

  • Trust keys by JWKS URL

    New signing keys are picked up without a code change.

  • Retry 5xx with backoff, never invalid_grant

    Authorization codes are single use.

Standards supported in this release. RFC 8693 and RFC 7009 status is on release status.

  • OAuth 2.0
  • OpenID Connect
  • RFC 9728
  • RFC 8414
  • RFC 7591
  • RFC 7636
  • RFC 7523

Get an AIGW token in four requests

The quickstart covers discover, register, authorize with PKCE and exchange, with curl and Node samples against the Evaluation environment.