Commit 4193c6a
* fix: OAuth token exchange fails with 500 for public PKCE clients (#576)
Three fixes for OAuth flow failing when claude.ai connects via MCP:
1. Allow public clients (no client_secret) using PKCE code_verifier for
identity proof per OAuth 2.1 §2.1 — previously authenticate_client()
was called with empty string, always failing authentication.
2. Add /.well-known/oauth-protected-resource endpoint (RFC 9728) which
was returning 404 — required by MCP spec for OAuth discovery.
3. Add exc_info=True to error logging in token and authorization
endpoints so actual exceptions are visible in logs instead of
generic "Token endpoint error" messages.
Closes #576
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Update src/mcp_memory_service/web/oauth/authorization.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Update src/mcp_memory_service/web/oauth/discovery.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix: address code review security findings
- Enforce PKCE (code_verifier) for public clients — prevents zero-auth
token exchange when no client_secret and no PKCE challenge (OAuth 2.1 §7.5.2)
- Fix type annotation: final_client_secret is Optional[str], not str
- Fix resource_documentation: remove broken _docs_endpoint_exists() call
from committed suggestion, use FastAPI's default /docs endpoint URL
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Heinrich Krupp <hkr@Mac-mini-von-Heinrich.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 8a9a0e5 commit 4193c6a
File tree
3 files changed
+74
-14
lines changed- src/mcp_memory_service/web/oauth
3 files changed
+74
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
342 | 365 | | |
343 | 366 | | |
344 | 367 | | |
| |||
507 | 530 | | |
508 | 531 | | |
509 | 532 | | |
510 | | - | |
| 533 | + | |
511 | 534 | | |
512 | 535 | | |
513 | 536 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
32 | 51 | | |
33 | 52 | | |
34 | 53 | | |
| |||
49 | 68 | | |
50 | 69 | | |
51 | 70 | | |
52 | | - | |
| 71 | + | |
53 | 72 | | |
54 | 73 | | |
55 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
| |||
0 commit comments