mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 21:14:17 +02:00
refactor: replace auth provider registry with ImportString (#1710)
This commit is contained in:
parent
bc25802a28
commit
deff09fe07
29 changed files with 276 additions and 326 deletions
|
|
@ -137,20 +137,24 @@ The client caches tokens locally, so you won't need to re-authenticate for subse
|
|||
|
||||
## Environment Variables
|
||||
|
||||
For production deployments, use environment variables instead of hardcoding credentials.
|
||||
<VersionBadge version="2.12.1" />
|
||||
|
||||
<Info>
|
||||
To use the registered GitHub provider, you must set `FASTMCP_SERVER_AUTH=GITHUB`. Learn more about [registered providers](/servers/auth/authentication#registered-providers).
|
||||
</Info>
|
||||
For production deployments, use environment variables instead of hardcoding credentials.
|
||||
|
||||
### Provider Selection
|
||||
|
||||
<ParamField path="FASTMCP_SERVER_AUTH" default="Not set" required>
|
||||
Set to `GITHUB` to use the registered GitHubProvider with default configuration.
|
||||
Setting this environment variable allows the GitHub provider to be used automatically without explicitly instantiating it in code.
|
||||
|
||||
<Card>
|
||||
<ParamField path="FASTMCP_SERVER_AUTH" default="Not set">
|
||||
Set to `fastmcp.server.auth.providers.github.GitHubProvider` to use GitHub authentication.
|
||||
</ParamField>
|
||||
</Card>
|
||||
|
||||
### GitHub-Specific Configuration
|
||||
|
||||
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>
|
||||
Your GitHub OAuth App Client ID (e.g., `Ov23liAbcDefGhiJkLmN`)
|
||||
|
|
@ -179,8 +183,8 @@ HTTP request timeout for GitHub API calls
|
|||
|
||||
Example `.env` file:
|
||||
```bash
|
||||
# Use the registered GitHub provider
|
||||
FASTMCP_SERVER_AUTH=GITHUB
|
||||
# Use the GitHub provider
|
||||
FASTMCP_SERVER_AUTH=fastmcp.server.auth.providers.github.GitHubProvider
|
||||
|
||||
# GitHub OAuth credentials
|
||||
FASTMCP_SERVER_AUTH_GITHUB_CLIENT_ID=Ov23liAbcDefGhiJkLmN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue