Commit 6ced33b
Make refresh_token grant type optional in DCR handler
Updated the Dynamic Client Registration (DCR) handler to comply with RFC 7591
by making the refresh_token grant type optional. Previously, the handler
incorrectly required both authorization_code and refresh_token grant types,
which was unnecessarily restrictive and non-compliant with the RFC.
Changes:
- Modified grant_types validation to only require authorization_code
- Updated error message to reflect the new requirement
- Renamed test to test_client_registration_with_authorization_code_only
- Added test for missing authorization_code (now the true error case)
- Updated test assertions to match new validation behavior
This change improves RFC 7591 compliance and provides clients with greater
flexibility in their registration options.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Github-Issue: #16501 parent c51936f commit 6ced33b
File tree
2 files changed
+20
-4
lines changed- src/mcp/server/auth/handlers
- tests/server/fastmcp/auth
2 files changed
+20
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
889 | 889 | | |
890 | 890 | | |
891 | 891 | | |
892 | | - | |
| 892 | + | |
| 893 | + | |
893 | 894 | | |
894 | 895 | | |
895 | 896 | | |
896 | 897 | | |
897 | 898 | | |
898 | 899 | | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
899 | 915 | | |
900 | 916 | | |
901 | 917 | | |
902 | 918 | | |
903 | 919 | | |
904 | | - | |
| 920 | + | |
905 | 921 | | |
906 | 922 | | |
907 | 923 | | |
| |||
0 commit comments