picklepete / pyicloud

A Python + iCloud wrapper to access iPhone and Calendar data.
MIT License
2.57k stars 452 forks source link

non-2FA account marked as needing Repair, causing pyicloud login failure #405

Open Ghawken opened 2 years ago

Ghawken commented 2 years ago

Hi

Seems there are various reports of 421 authentication failure & incorrect username/password failures…

392

391

379

357

& https://stackoverflow.com/questions/69983478/account-without-2fa-2sa-cant-be-logged-in-by-pyicloud

Seeing this myself with a non-2FA account previously working solidly.

It seems that issue arises because the non-2FA account has been marked by icloud as needing ‘repair’. (likely because of its failure to have 2FA enabled)

The web browser login, does not complete as usual, instead it takes 2 ‘widgets’ which ask you to upgrade to 2FA. Can then select “Other Options” in first widget, and then “Don’t Upgrade” in second.
Following completion of both these widgets - the web browser then logins.

This login difference is leading to pyiclouds failure I believe.

The above issues seem to relate to these widgets not allowing usual login process, and the apple icloud account being marked as needing ‘repair’

Unfortunately I cannot move this account out of needing repair and suspect that it will probably apply to all non-2FA accounts soon/already….
Meaning that unless fix to move account out of needing ‘repair’, or dealing with these 2 widget requests pyicloud may not function for non-2FA accounts…

Ghawken commented 2 years ago

Further to this:

Confirmed - new install, non-2FA account, failure to login.

It appears you can send a GET to https://appleid.apple.com/account/security/upgrade/setuplater Once the Widget appears, to cancel the widget request to upgrade account to 2FA

Cannot currently figure out what the above URL wants from Headers/Cookies/data - constantly getting a Forbidden (403) when try inside pyicloud code.