Commit ebff435
committed
fix: skip eager token refresh when OAuth metadata is unavailable
When the auth server lives under a non-root path (e.g. /oauth2/api/v1/token),
the eager refresh at the top of async_auth_flow used the fallback
urljoin(get_authorization_base_url(server_url), '/token') which strips the
path, hitting the wrong endpoint.
Fix: only attempt the eager refresh when oauth_metadata is already populated
(i.e. we know the real token_endpoint). Without metadata, let the request
proceed with the stale token, receive a 401, and run full PRM/ASM discovery
before retrying — which resolves the correct token endpoint.
Fixes #32401 parent 1216c53 commit ebff435
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
540 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
541 | 550 | | |
542 | 551 | | |
543 | 552 | | |
| |||
0 commit comments