How authentication works
1
Client requests /mcp
The MCP client sends an initial request to
/mcp without a token. The server responds with 401 Unauthorized and a WWW-Authenticate header containing a link to the protected resource metadata.2
Client discovers OAuth metadata
The client fetches the protected resource metadata (RFC 9728), which points to the authorization server. It then fetches the authorization server metadata (RFC 8414) to learn the OAuth endpoints.
3
Dynamic client registration
The client registers itself via the
/oauth/register endpoint (RFC 7591) and receives a client_id.4
User authorizes
The client redirects the user to
/oauth/authorize, which proxies to Auth0’s authorization endpoint. The user logs in (or signs up) and grants access. Auth0 redirects back with an authorization code.5
Token exchange
The client sends the authorization code to
/oauth/token, which proxies to Auth0’s token endpoint and injects the client secret. The client receives an access token.6
Authenticated requests
All subsequent requests to
/mcp include the access token as a Bearer token. The server validates it and forwards it to the Vero API.OAuth endpoints
The server implements the following OAuth-related endpoints:Token validation
The server supports two token validation strategies depending on configuration:- JWT (recommended)
- Opaque tokens
When an Auth0 API audience is configured, tokens are signed JWTs. The server validates them locally:
- Fetches the JSON Web Key Set (JWKS) from Auth0
- Caches keys for 5 minutes
- Verifies the JWT signature (RSA)
- Validates the issuer (
iss), expiration (exp), and audience (aud) claims
Scopes
The server requests the following OAuth scopes during authorization:Token flow through the system
Once authenticated, the user’s Bearer token flows through the entire system:PKCE support
The authorization server metadata advertises support forS256 code challenge method (PKCE). MCP clients that implement PKCE will use it automatically for added security during the authorization code exchange.