mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 21:44:18 +02:00
AuthKit: auto-bind token audience to resource URL (RFC 8707) (#3905)
This commit is contained in:
parent
c2dafc1c88
commit
82f310fe61
33 changed files with 265 additions and 114 deletions
|
|
@ -6,7 +6,7 @@ Demonstrates FastMCP server protection with GitHub OAuth.
|
|||
|
||||
1. Create a GitHub OAuth App:
|
||||
- Go to GitHub Settings > Developer settings > OAuth Apps
|
||||
- Set Authorization callback URL to: `http://localhost:8000/auth/callback`
|
||||
- Set Authorization callback URL to: `http://127.0.0.1:8000/auth/callback`
|
||||
- Copy the Client ID and Client Secret
|
||||
|
||||
2. Set environment variables:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import asyncio
|
|||
|
||||
from fastmcp.client import Client, OAuth
|
||||
|
||||
SERVER_URL = "http://localhost:8000/mcp"
|
||||
SERVER_URL = "http://127.0.0.1:8000/mcp"
|
||||
|
||||
|
||||
async def main():
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from fastmcp.server.auth.providers.github import GitHubProvider
|
|||
auth = GitHubProvider(
|
||||
client_id=os.getenv("FASTMCP_SERVER_AUTH_GITHUB_CLIENT_ID") or "",
|
||||
client_secret=os.getenv("FASTMCP_SERVER_AUTH_GITHUB_CLIENT_SECRET") or "",
|
||||
base_url="http://localhost:8000",
|
||||
base_url="http://127.0.0.1:8000",
|
||||
# redirect_path="/auth/callback", # Default path - change if using a different callback URL
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue