Tagged “oauth2”

3 posts · View all tags
Give each MCP tool its own scope, and return a refusal the client can act on
IntermediatePart 10

Give each MCP tool its own scope, and return a refusal the client can act on

Part 6 gated the whole server with one scope, which meant the token that let an agent look up a customer also let it issue refunds. Splitting that per tool is easy. Making the refusal useful is not: the obvious implementation returns HTTP 200 with the error buried in the body, so a client has nothing to trigger step-up authorization on. Getting the 403 and WWW-Authenticate challenge the spec defines means leaving the framework's abstraction entirely — and the version that does it decodes the token a second time, unverified.

Agentsself-hostingmcpsecurity
September 18, 202612 min read
Read more
The wrong valid token: authenticating an MCP tools server with authentik
IntermediatePart 6

The wrong valid token: authenticating an MCP tools server with authentik

Agent orchestration part 4 scoped tools in the client and admitted the server still trusted whoever reached the port. This puts a JWT verifier in front of it, with its own authentik client, so the tools server refuses anonymous callers — and refuses the gateway's own valid token, because a separate provider means a separate issuer. Includes the documented client-credentials helper that cannot work here, and the four silent 404s it produces instead of saying so.

Agentsself-hostingmcpsecurity
September 10, 202616 min read
Read more
The key that expires: giving an agent its own identity at the gateway
IntermediatePart 5

The key that expires: giving an agent its own identity at the gateway

Part 4 ended with a shell, a static key and a model that answered. This replaces that key with a token your identity provider issues, that carries a scope, and that dies after five minutes. authentik issues it over client credentials, the gateway verifies it in twenty-five lines, and three status codes prove the boundary. Includes the requirement authentik doesn't document, and the licence wall you hit if you follow LiteLLM's own guide.

Agentsgatewaylitellmsecurity
September 8, 202618 min read
Read more