go-sdk/auth
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sam Thanawalla 069aae16df
mcp: add client-side OAuth flow (#544)
This is a preliminary implementation of OAuth 2.1 for the client.

When a StreamableClientTransport encounters a 401 Unauthorized response
from the server, it initiates the OAuth flow described in thec
authorization section of the MCP spec

(https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization).
On success, the transport obtains an access token which it passes
to all subsequent requests.

Much remains to be done here:

* Resource Indicators, as described in section 2.5.1 of the MCP spec.

* All of this is unexported, so it is available only to our own
StreamingClientTransport. We should add API so people can use it
with their own transports.

* And, of course, tests. We should test against fake implementations
but also, if we can find any, real reference implementations.

For #19
Co-authored-by: Jonathan Amsterdam <jba@google.com>

---------

Co-authored-by: Jonathan Amsterdam <jba@google.com>
2025-09-30 16:16:30 -04:00
..
auth.go many: minor cosmetic changes (#529) 2025-09-25 16:06:24 -04:00
auth_test.go add HTTP Request to TokenVerifier (#404) 2025-09-03 16:23:42 -04:00
client.go mcp: add client-side OAuth flow (#544) 2025-09-30 16:16:30 -04:00
client_test.go mcp: add client-side OAuth flow (#544) 2025-09-30 16:16:30 -04:00