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
Copy file name to clipboardExpand all lines: docs/servers/auth/oauth-proxy.mdx
+57-36Lines changed: 57 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,14 @@ MCP clients expect to register automatically and obtain credentials on the fly,
16
16
17
17
This approach enables any MCP client (whether using random localhost ports or fixed URLs like Claude.ai) to authenticate with any traditional OAuth provider, all while maintaining full OAuth 2.1 and PKCE security.
18
18
19
+
<Note>
20
+
For providers that support OIDC discovery (Auth0, Google with OIDC
21
+
configuration, Azure AD), consider using [`OIDC
22
+
Proxy`](/servers/auth/oidc-proxy) for automatic configuration. OIDC Proxy
23
+
extends OAuth Proxy to automatically discover endpoints from the provider's
Whether to forward PKCE (Proof Key for Code Exchange) to the upstream OAuth provider. When enabled and the client uses PKCE, the proxy generates its own PKCE parameters to send upstream while separately validating the client's PKCE. This ensures end-to-end PKCE security at both layers (client-to-proxy and proxy-to-upstream).
124
-
-`True` (default): Forward PKCE for providers that support it (Google, Azure, GitHub, etc.)
125
-
-`False`: Disable only if upstream provider doesn't support PKCE
134
+
Whether to forward PKCE (Proof Key for Code Exchange) to the upstream OAuth
135
+
provider. When enabled and the client uses PKCE, the proxy generates its own
136
+
PKCE parameters to send upstream while separately validating the client's
137
+
PKCE. This ensures end-to-end PKCE security at both layers (client-to-proxy
138
+
and proxy-to-upstream). - `True` (default): Forward PKCE for providers that
139
+
support it (Google, Azure, GitHub, etc.) - `False`: Disable only if upstream
Token endpoint authentication method for the upstream OAuth server. Controls how the proxy authenticates when exchanging authorization codes and refresh tokens with the upstream provider.
130
-
-`"client_secret_basic"`: Send credentials in Authorization header (most common)
131
-
-`"client_secret_post"`: Send credentials in request body (required by some providers)
List of all possible valid scopes for the OAuth provider. These are advertised to clients through the `/.well-known` endpoints. Defaults to `required_scopes` from your TokenVerifier if not specified.
164
+
List of all possible valid scopes for the OAuth provider. These are advertised
165
+
to clients through the `/.well-known` endpoints. Defaults to `required_scopes`
Additional parameters to forward to the upstream token endpoint during code exchange and token refresh. Useful for provider-specific requirements during token operations.
164
182
165
-
For example, some providers require additional context during token exchange:
Storage backend for persisting OAuth client registrations. By default, clients are automatically persisted to disk in `~/.config/fastmcp/oauth-proxy-clients/`, allowing them to survive server restarts as long as the filesystem remains accessible. This means MCP clients only need to register once and can reconnect seamlessly after your server restarts.
175
195
176
-
```python
177
-
from fastmcp.utilities.storage import InMemoryStorage
196
+
```python
197
+
from fastmcp.utilities.storage import InMemoryStorage
198
+
199
+
# Use in-memory storage for testing (clients lost on restart)
Storage backend for persisting OAuth client registrations. By default, clients are automatically persisted to disk in `~/.config/fastmcp/oidc-proxy-clients/`, allowing them to survive server restarts as long as the filesystem remains accessible. This means MCP clients only need to register once and can reconnect seamlessly after your server restarts.
134
+
135
+
```python
136
+
from fastmcp.utilities.storage import InMemoryStorage
137
+
138
+
# Use in-memory storage for testing (clients lost on restart)
0 commit comments