Config.AuthorizationServer. It is opt-in: callers who do not set this field get the v1.0 surface unchanged.
Wiring the AS
EncryptionKey is required when AuthorizationServer is set. It protects the Ed25519 signing key at rest.
Endpoints
OnceAuthorizationServer is set, a.Mount(r) adds the endpoints below. They sit at the root of the router you pass in, not under /auth like the sign-in routes. A few things follow from that:
- Call
a.Mounton your top-level router. If you mount it on a sub-router, every URL below gets that prefix, and the URLs the server advertises in its metadata will not match. - Set
Issuerto a bare origin such ashttps://as.example.com. The metadata route is registered only at the root, so an issuer with a path (https://example.com/tenant1) will not be discoverable.
/.well-known/oauth-authorization-server. It lists the issuer and the full URL of every endpoint your configuration turned on.
Discovery
Clients and resource servers start here.
The per-resource route only finds resources that live under the issuer’s own host. If your API runs somewhere else, such as
https://api.example.com, serve its protected resource metadata from that host. The resource server package does this for you.
Getting a token
Enabled by configuration
Dynamic Client Registration
Agent identities and delegation
AddConfig.AgentIdentity to enable agent CRUD and the delegation grant system:
Trusted proxies
By default,X-Forwarded-For is not trusted. Enable it for specific proxy prefixes:
Key rotation
Signing keys rotate every 30 days. The JWKS endpoint always serves the current and one previous key so resource servers with a cached JWKS can verify tokens minted before the rotation. Calla.RotateSigningKey(ctx) to rotate ahead of schedule.
Admin surface for agents and delegations
When RBAC is enabled, the admin API gains org-scoped agent and delegation management:agents:admin and delegations:admin RBAC permissions respectively.
Next steps
- Resource Server (mcpresource) - The consumption side.
- Configuration Reference - Full config shape.
- Add an OAuth Provider - Add social sign-in on top of the AS.