Commit 7445cb3
fix(oauth): add OpenID Configuration endpoint for ChatGPT compatibility (#531)
* fix(oauth): add OpenID Configuration endpoint for ChatGPT compatibility
ChatGPT's MCP connector expects /.well-known/openid-configuration in addition
to /.well-known/oauth-authorization-server. Per RFC 8414, many OAuth servers
support both endpoints with identical metadata for compatibility.
This adds the openid-configuration endpoint that returns the same enhanced
metadata as the oauth-authorization-server endpoint, fixing ChatGPT integration
while maintaining claude.ai compatibility.
Fixes #368
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(oauth): grant default scopes when client registers without them
ChatGPT MCP connector registers clients without specifying scopes,
then requests scopes during authorization. The MCP SDK rejects this
with "invalid_scope: Client was not registered with scope X".
Fix: When a client registers without scopes, automatically grant all
valid scopes (homeassistant, mcp). This allows ChatGPT to complete
the OAuth flow while maintaining security (only valid scopes granted).
Changes:
- Auto-grant valid scopes when client_info.scope is None
- Add test for ChatGPT compatibility behavior
- Log when default scopes are granted for visibility
Fixes the "invalid_scope" error shown in network traces
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 72f6426 commit 7445cb3
2 files changed
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
251 | 266 | | |
252 | 267 | | |
253 | 268 | | |
| |||
263 | 278 | | |
264 | 279 | | |
265 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
266 | 292 | | |
267 | 293 | | |
268 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
155 | 174 | | |
156 | 175 | | |
157 | 176 | | |
| |||
508 | 527 | | |
509 | 528 | | |
510 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
511 | 545 | | |
512 | 546 | | |
513 | 547 | | |
| |||
0 commit comments