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
### 4. Use Authorized Streamable HTTP Transport and create client
147
+
### 5. Use Authorized Streamable HTTP Transport and create client
71
148
72
149
```rust ignore
73
150
letam=oauth_state
@@ -84,7 +161,7 @@ If you know the scopes you need, you can still pass them explicitly:
84
161
letclient=client_service.serve(transport).await?;
85
162
```
86
163
87
-
### 5. Handle scope upgrades
164
+
### 6. Handle scope upgrades
88
165
89
166
If a server returns 403 with `insufficient_scope`, you can request a scope
90
167
upgrade. The SDK computes the union of current and required scopes and
@@ -134,6 +211,7 @@ cargo run -p mcp-client-examples --example clients_oauth_client
134
211
135
212
-**PKCE S256 always enforced**: never falls back to `plain` or no challenge. OAuth 2.1 mandates S256 as Mandatory To Implement for servers.
136
213
-**RFC 8707 resource binding**: authorization and token requests include the `resource` parameter to bind tokens to the protected resource
214
+
-**Redirect policy is explicit for custom OAuth clients**: discovery and registration requests use `OAuthHttpRedirectPolicy::Follow`, while token requests use `OAuthHttpRedirectPolicy::Stop` so custom implementations can avoid forwarding credentials to redirected endpoints
137
215
- All tokens are securely stored in memory (custom credential stores supported)
138
216
- Automatic token refresh reduces user intervention
139
217
- Server metadata validation warns on non-compliant configurations but proceeds where relatively safe
@@ -147,7 +225,9 @@ If you encounter authorization issues, check the following:
147
225
3. Check network connection and firewall settings
148
226
4. Verify server supports metadata discovery or dynamic client registration
149
227
5. If PKCE fails, the server may not support S256 (non-compliant with OAuth 2.1)
150
-
6. Check `tracing` logs at debug level for detailed discovery and validation info
228
+
6. If OAuth requests need custom proxy, TLS, or connector settings, pass a configured reqwest client to `OAuthState::new`
229
+
7. If OAuth requests must run through a non-reqwest environment, implement `OAuthHttpClient` and use `OAuthState::new_with_oauth_http_client`
230
+
8. Check `tracing` logs at debug level for detailed discovery and validation info
0 commit comments