For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Auth0
Use Auth0 access tokens with agentgateway
Auth0 is an identity platform that provides authentication and authorization services. agentgateway can validate access tokens issued by Auth0 with mcpAuthentication.
Why use Auth0 with agentgateway?
- Managed identity - No infrastructure to maintain
- Social login - Google, GitHub, Microsoft, and more
- Enterprise SSO - SAML, LDAP, Active Directory
- MFA - Built-in multi-factor authentication
- API protection - JWT-based token validation for MCP services
Configuration
Configure agentgateway to validate Auth0 tokens and publish MCP protected-resource metadata:
# yaml-language-server: $schema=https://agentgateway.dev/schema/config
binds:
- port: 3000
listeners:
- routes:
- backends:
- mcp:
targets:
- name: my-server
stdio:
cmd: npx
args: ["@modelcontextprotocol/server-everything"]
matches:
- path:
exact: /mcp
- path:
exact: /.well-known/oauth-protected-resource/mcp
policies:
mcpAuthentication:
issuer: https://your-tenant.auth0.com/
jwks:
url: https://your-tenant.auth0.com/.well-known/jwks.json
resourceMetadata:
resource: https://gateway.example.com/mcp
scopesSupported:
- read:all
bearerMethodsSupported:
- headerAuth0 setup
Create an API in the Auth0 Dashboard:
- Name:
agentgateway API - Identifier:
https://api.example.com
- Name:
Create an Application:
- Type: Single Page Application or Machine to Machine
- Note the Client ID and Client Secret
Configure the allowed callbacks and origins for any browser clients that will obtain tokens from Auth0.
Getting a token
Machine-to-machine
curl -X POST "https://your-tenant.auth0.com/oauth/token" \
-H "Content-Type: application/json" \
-d '{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"audience": "https://api.example.com",
"grant_type": "client_credentials"
}'Using the token
curl http://localhost:3000/mcp \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"initialize",...}'Authorization
Auth0 does not require a provider-specific authorization schema in agentgateway. If you need authorization, use the generic HTTP authorization or MCP authorization policies against claims that your Auth0 tenant actually emits.