Skip to content

Commit d927bc0

Browse files
committed
Set issuer to AS URI for RFC8414 compliance in auth example
1 parent 7c65d76 commit d927bc0

File tree

1 file changed

+3
-3
lines changed
  • examples/servers/simple-auth-client-credentials/mcp_simple_auth_client_credentials

1 file changed

+3
-3
lines changed

examples/servers/simple-auth-client-credentials/mcp_simple_auth_client_credentials/auth_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class AuthServerSettings(BaseModel):
4343
port: int = 9000
4444
server_url: AnyHttpUrl = AnyHttpUrl("http://localhost:9000")
4545

46-
def create_authorization_server() -> Starlette:
46+
def create_authorization_server(server_settings: AuthServerSettings) -> Starlette:
4747
"""Create the Authorization Server application."""
4848

4949
routes = [
@@ -52,7 +52,7 @@ def create_authorization_server() -> Starlette:
5252
"/.well-known/oauth-authorization-server",
5353
endpoint=cors_middleware(
5454
MetadataHandler(metadata=OAuthMetadata(
55-
issuer=AnyHttpUrl(API_BASE),
55+
issuer=server_settings.server_url,
5656
authorization_endpoint=AnyHttpUrl(f"{API_ENDPOINT}/oauth2/authorize"),
5757
token_endpoint=AnyHttpUrl(f"{API_ENDPOINT}/oauth2/token"),
5858
token_endpoint_auth_methods_supported=["client_secret_basic"],
@@ -71,7 +71,7 @@ def create_authorization_server() -> Starlette:
7171

7272
async def run_server(server_settings: AuthServerSettings):
7373
"""Run the Authorization Server."""
74-
auth_server = create_authorization_server()
74+
auth_server = create_authorization_server(server_settings)
7575

7676
config = Config(
7777
auth_server,

0 commit comments

Comments
 (0)