Commit e06420a
Fix Cloudflare SSO blocking with Safari TLS impersonation and multi-strategy login
Cloudflare blocks programmatic SSO login based on TLS fingerprinting.
Safari impersonation via curl_cffi bypasses this where Chrome gets 429'd.
- Add portal web login (/portal/api/login) as primary strategy with
desktop browser headers — Garmin's own website uses this endpoint
- Try multiple curl_cffi TLS impersonations: safari, safari_ios,
chrome120, edge101, chrome (safari works best)
- Fall through 429/connection errors to next strategy instead of failing
- Add random browser UA generation via ua-generator to avoid fingerprinting
- Use curl_cffi for DI token exchange and refresh (not just login)
- Try both portal and mobile MFA endpoints with detailed error reporting
- Proactively refresh DI tokens on load if expiring soon
- Add ua-generator dependency to pyproject.toml
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 21aea2d commit e06420a
3 files changed
Lines changed: 361 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
440 | 451 | | |
441 | 452 | | |
442 | 453 | | |
| |||
0 commit comments