Commit 1d25235
Fix SSO authentication polling to properly handle AuthorizationPendingException
The previous implementation was incorrectly treating AuthorizationPendingException
as a fatal error instead of continuing to poll for authorization completion.
Changes:
- Import proper AWS SDK v2 error types for SSO OIDC
- Use typed error checking with errors.As() instead of string matching
- Handle AuthorizationPendingException and SlowDownException correctly
- Add fallback string matching for compatibility
- Include user-friendly polling status messages
- Continue polling until user completes browser authorization
This fixes the authentication flow where users would click "Allow" in the browser
but the CLI would exit with an error instead of completing the login process.
Tested with real AWS SSO instance and confirmed working end-to-end:
- Device authorization flow starts correctly
- Browser opens with verification URL and code
- Polling continues while waiting for user authorization
- Successfully completes login once user approves in browser
- Token is cached for subsequent operations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 9802146 commit 1d25235
1 file changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
343 | 346 | | |
344 | 347 | | |
345 | 348 | | |
346 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
347 | 364 | | |
348 | 365 | | |
349 | 366 | | |
| |||
0 commit comments