Resource metadata is remembered throughout the entire login flow. #167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There currently is a problem with MCP servers that rely on a remote authorization server at a different host. During OAuth login the /authorize request is made to the correct authorization server, but the /token request is made against the MCP server.
Due to creating multiple transports and recursive invocations of
connectToRemoteServer()
, the acquired resource metadata (containing the correct authorization server) was forgotten between /authorize and /token calls.Unfortunately the
transport
has the resource metadata in a private field, so I inject it by bypassing the typesystem. Going forward there should be only a single transport used for everything and no recursions. For now I consider this fix the bare minimum to get spec compliant OAuth to working at all.