Skip to content

Commit 061739d

Browse files
committed
add consent
1 parent 21c974c commit 061739d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/mcp/server/auth/handlers/consent.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ async def _show_consent_form(self, request: Request) -> HTMLResponse:
3333
code_challenge = request.query_params.get("code_challenge", "")
3434
response_type = request.query_params.get("response_type", "")
3535

36+
# Get client info to display client_name
37+
client_name = client_id # Default to client_id if we can't get the client
38+
if client_id:
39+
client = await self.provider.get_client(client_id)
40+
if client and hasattr(client, 'client_name'):
41+
client_name = client.client_name
42+
3643
# TODO: get this passed in
3744
target_url = "/consent"
3845

@@ -118,9 +125,10 @@ async def _show_consent_form(self, request: Request) -> HTMLResponse:
118125
<body>
119126
<div class="consent-form">
120127
<h1>Authorization Request</h1>
121-
<p>The application <strong>{client_id}</strong> is requesting access to your resources.</p>
128+
<p>The application <strong>{client_name}</strong> is requesting access to your resources.</p>
122129
123130
<div class="client-info">
131+
<strong>Application Name:</strong> {client_name}<br>
124132
<strong>Client ID:</strong> {client_id}<br>
125133
<strong>Redirect URI:</strong> {redirect_uri}
126134
</div>

0 commit comments

Comments
 (0)