mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 13:34:17 +02:00
Update documentation to use DCR-suffixed provider names
All OAuth provider references updated from old names (GitHubProvider, GoogleProvider, etc.) to new DCR-suffixed names (GitHubDCRProvider, GoogleDCRProvider, etc.) including environment variable names. Updated files: - Authentication docs (oauth-proxy.mdx, oidc-proxy.mdx, authentication.mdx) - Integration guides (github.mdx, google.mdx, azure.mdx, workos.mdx, auth0.mdx, aws-cognito.mdx) - Deployment guide (http.mdx) - Storage backends guide (storage-backends.mdx) - Upgrade guide (upgrade-guide.mdx)
This commit is contained in:
parent
a48d753d16
commit
f5c5d20517
12 changed files with 171 additions and 171 deletions
|
|
@ -43,7 +43,7 @@ Create an OAuth App in your GitHub settings to get the credentials needed for au
|
|||
</Warning>
|
||||
|
||||
<Tip>
|
||||
If you want to use a custom callback path (e.g., `/auth/github/callback`), make sure to set the same path in both your GitHub OAuth App settings and the `redirect_path` parameter when configuring the GitHubProvider.
|
||||
If you want to use a custom callback path (e.g., `/auth/github/callback`), make sure to set the same path in both your GitHub OAuth App settings and the `redirect_path` parameter when configuring the GitHubDCRProvider.
|
||||
</Tip>
|
||||
</Step>
|
||||
|
||||
|
|
@ -61,14 +61,14 @@ Create an OAuth App in your GitHub settings to get the credentials needed for au
|
|||
|
||||
### Step 2: FastMCP Configuration
|
||||
|
||||
Create your FastMCP server using the `GitHubProvider`, which handles GitHub's OAuth quirks automatically:
|
||||
Create your FastMCP server using the `GitHubDCRProvider`, which handles GitHub's OAuth flow automatically:
|
||||
|
||||
```python server.py
|
||||
from fastmcp import FastMCP
|
||||
from fastmcp.server.auth.providers.github import GitHubProvider
|
||||
from fastmcp.server.auth.providers.github import GitHubDCRProvider
|
||||
|
||||
# The GitHubProvider handles GitHub's token format and validation
|
||||
auth_provider = GitHubProvider(
|
||||
# The GitHubDCRProvider handles GitHub's token format and validation
|
||||
auth_provider = GitHubDCRProvider(
|
||||
client_id="Ov23liAbcDefGhiJkLmN", # Your GitHub OAuth App Client ID
|
||||
client_secret="github_pat_...", # Your GitHub OAuth App Client Secret
|
||||
base_url="http://localhost:8000", # Must match your OAuth App configuration
|
||||
|
|
@ -84,7 +84,7 @@ async def get_user_info() -> dict:
|
|||
from fastmcp.server.dependencies import get_access_token
|
||||
|
||||
token = get_access_token()
|
||||
# The GitHubProvider stores user data in token claims
|
||||
# The GitHubDCRProvider stores user data in token claims
|
||||
return {
|
||||
"github_user": token.claims.get("login"),
|
||||
"name": token.claims.get("name"),
|
||||
|
|
@ -147,7 +147,7 @@ Setting this environment variable allows the GitHub provider to be used automati
|
|||
|
||||
<Card>
|
||||
<ParamField path="FASTMCP_SERVER_AUTH" default="Not set">
|
||||
Set to `fastmcp.server.auth.providers.github.GitHubProvider` to use GitHub authentication.
|
||||
Set to `fastmcp.server.auth.providers.github.GitHubDCRProvider` to use GitHub authentication.
|
||||
</ParamField>
|
||||
</Card>
|
||||
|
||||
|
|
@ -156,31 +156,31 @@ Set to `fastmcp.server.auth.providers.github.GitHubProvider` to use GitHub authe
|
|||
These environment variables provide default values for the GitHub provider, whether it's instantiated manually or configured via `FASTMCP_SERVER_AUTH`.
|
||||
|
||||
<Card>
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_CLIENT_ID" required>
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_DCR_CLIENT_ID" required>
|
||||
Your GitHub OAuth App Client ID (e.g., `Ov23liAbcDefGhiJkLmN`)
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_CLIENT_SECRET" required>
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_DCR_CLIENT_SECRET" required>
|
||||
Your GitHub OAuth App Client Secret
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_BASE_URL" default="http://localhost:8000">
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_DCR_BASE_URL" default="http://localhost:8000">
|
||||
Public URL where OAuth endpoints will be accessible (includes any mount path)
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_ISSUER_URL" default="Uses BASE_URL">
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_DCR_ISSUER_URL" default="Uses BASE_URL">
|
||||
Issuer URL for OAuth metadata (defaults to `BASE_URL`). Set to root-level URL when mounting under a path prefix to avoid 404 logs. See [HTTP Deployment guide](/deployment/http#mounting-authenticated-servers) for details.
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_REDIRECT_PATH" default="/auth/callback">
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_DCR_REDIRECT_PATH" default="/auth/callback">
|
||||
Redirect path configured in your GitHub OAuth App
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_REQUIRED_SCOPES" default='["user"]'>
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_DCR_REQUIRED_SCOPES" default='["user"]'>
|
||||
Comma-, space-, or JSON-separated list of required GitHub scopes (e.g., `user repo` or `["user","repo"]`)
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_TIMEOUT_SECONDS" default="10">
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_GITHUB_DCR_TIMEOUT_SECONDS" default="10">
|
||||
HTTP request timeout for GitHub API calls
|
||||
</ParamField>
|
||||
</Card>
|
||||
|
|
@ -188,13 +188,13 @@ HTTP request timeout for GitHub API calls
|
|||
Example `.env` file:
|
||||
```bash
|
||||
# Use the GitHub provider
|
||||
FASTMCP_SERVER_AUTH=fastmcp.server.auth.providers.github.GitHubProvider
|
||||
FASTMCP_SERVER_AUTH=fastmcp.server.auth.providers.github.GitHubDCRProvider
|
||||
|
||||
# GitHub OAuth credentials
|
||||
FASTMCP_SERVER_AUTH_GITHUB_CLIENT_ID=Ov23liAbcDefGhiJkLmN
|
||||
FASTMCP_SERVER_AUTH_GITHUB_CLIENT_SECRET=github_pat_...
|
||||
FASTMCP_SERVER_AUTH_GITHUB_BASE_URL=https://your-server.com
|
||||
FASTMCP_SERVER_AUTH_GITHUB_REQUIRED_SCOPES=user,repo
|
||||
FASTMCP_SERVER_AUTH_GITHUB_DCR_CLIENT_ID=Ov23liAbcDefGhiJkLmN
|
||||
FASTMCP_SERVER_AUTH_GITHUB_DCR_CLIENT_SECRET=github_pat_...
|
||||
FASTMCP_SERVER_AUTH_GITHUB_DCR_BASE_URL=https://your-server.com
|
||||
FASTMCP_SERVER_AUTH_GITHUB_DCR_REQUIRED_SCOPES=user,repo
|
||||
```
|
||||
|
||||
With environment variables set, your server code simplifies to:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue