go-sdk/internal/oauthex
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
..
testdata internal/oauthex: add dynamic client registration (#519) 2025-09-29 09:29:12 -04:00
auth_meta.go internal/oauthex: add dynamic client registration (#519) 2025-09-29 09:29:12 -04:00
auth_meta_test.go internal/oauthex: add dynamic client registration (#519) 2025-09-29 09:29:12 -04:00
oauth2.go internal/oauthex: address URL attacks in PRM (#539) 2025-09-30 07:33:59 -04:00
oauth2_test.go internal/oauthex: fix license headers (#430) 2025-09-08 13:36:50 -04:00
resource_meta.go mcp: add client-side OAuth flow (#544) 2025-09-30 16:16:30 -04:00