You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 04336d0
Browse filesBrowse the repository at this point in the historyBrowse files
Select the advertised authorization server by the stored issuer
## Motivation and Context
Protected resource metadata may list several authorization servers, and the flow always took the first.
With `issuer:` on `ClientCredentialsProvider` and `CrossAppAccessProvider` that could not work:
a resource listing the configured server second was refused as a different authorization server,
although its metadata named the right one. A registered client fared the same: its stored client information records
the server that issued the registration, and it was registered again at the first entry instead.
The flow now prefers the entry naming the issuer recorded in the provider's client information, with
the single trailing slash tolerance the issuer checks apply, and falls back to the first entry when nothing
is recorded or listed; the checks that follow still decide, so a configured issuer the resource does not
list is refused as before. The Python SDK's client credentials provider selects the advertised server
the same way for its configured issuer.
## How Has This Been Tested?
test/mcp/client/oauth/flow_test.rb: a resource listing the configured issuer second runs both
machine-to-machine grants and the refresh at that server, a trailing slash difference still matches,
an issuer the resource does not list is refused, a provider without an issuer keeps the first entry,
and a registered client keeps its authorization server; before the change the tests that expect
the second entry fail by picking the first.
## Breaking Changes
None.
Copy file name to clipboardExpand all lines: docs/_client/authorization.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -321,10 +321,10 @@ Keyword arguments:
321
321
-`private_key`, `signing_algorithm`: Required with `private_key_jwt` - the key (a PEM string
322
322
or `OpenSSL::PKey::PKey`, never written to `storage`) signs the client assertion with `"ES256"`
323
323
or `"RS256"`; `client_secret` must not be set, because the private key is the credential.
324
-
-`issuer`: Optional. The issuer identifier of the authorization server the credentials belong to. A different authorization server raises
325
-
`Flow::AuthorizationError`. A single trailing slash difference is accepted, as in the TypeScript SDK. Omitting `issuer:` is deprecated
326
-
and emits a warning at construction. Without it, credentials go to whichever authorization server the MCP server names, as before.
327
-
To use credentials for another authorization server, construct a provider with that server's `issuer:` and credentials.
324
+
-`issuer`: Optional. The issuer identifier of the authorization server the credentials belong to. A different authorization server raises`Flow::AuthorizationError`.
325
+
A single trailing slash difference is accepted, as in the TypeScript SDK. When the protected resource metadata lists several authorization servers,
326
+
the one naming `issuer:` is used. Omitting `issuer:` is deprecated and emits a warning at construction. Without it, credentials go to whichever authorization server
327
+
the MCP server names, as before. To use credentials for another authorization server, construct a provider with that server's `issuer:` and credentials.
328
328
-`scope`, `storage`, `authorization_request_validator`, `token_request_params`, `http_client_customizer`: Optional, same meaning as on `Provider`.
329
329
Use `token_request_params` for a parameter the authorization server requires on the `client_credentials` grant, such as Auth0's `audience`.
0 commit comments