majd / ipatool

Command-line tool that allows searching and downloading app packages (known as ipa files) from the iOS App Store
MIT License
5.76k stars 487 forks source link

Problem with 2FA Authentication process #82

Closed sbakhour closed 2 years ago

sbakhour commented 2 years ago

This is a recurring issue, this morning for example with my first login auth it did not ask me for a 2FA & the login was successful,after downloading an app and everything was fine, once the token expired, it asked me to re-authenticate again, and here is the issue, it asks for 2FA but I never receive it. I tried to re-authenticate again and it always never sends the 2FA Code. Can you please fix this problem ? Thank you in advance.

sbakhour commented 2 years ago

sbbakhou@88665a23f3f2 ~ % ipatool auth login
==> ⚠️ [Warning] Enter Apple ID email: ==> ⚠️ [Warning] Enter Apple ID password: ==> ℹ️ [Info] Authenticating with the App Store... ==> ℹ️ [Info] Authenticated as 'Sam Mobilesec'.

sbbakhou@88665a23f3f2 ~ % ipatool auth login ==> ⚠️ [Warning] Enter Apple ID email: ==> ⚠️ [Warning] Enter Apple ID password: ==> ℹ️ [Info] Authenticating with the App Store... ==> ⚠️ [Warning] Enter 2FA code:

majd commented 2 years ago

Can you try using a manually generated 2FA code? On macOS, System Preferences -> Apple ID -> Get a Verification Code.

sbakhour commented 2 years ago

Hello @majd , I tried this and it doesn't work, below is what happens.

sbbakhou@88665a23f3f2 ~ % ipatool auth login
==> ⚠️ [Warning] Enter Apple ID email: ==> ⚠️ [Warning] Enter Apple ID password: ==> ℹ️ [Info] Authenticating with the App Store... ==> ⚠️ [Warning] Enter 2FA code: ==> ❌ [Error] An unknown error has occurred. sbbakhou@88665a23f3f2 ~ % ipatool auth login ==> ⚠️ [Warning] Enter Apple ID email: ==> ⚠️ [Warning] Enter Apple ID password: ==> ℹ️ [Info] Authenticating with the App Store... ==> ⚠️ [Warning] Enter 2FA code: ==> ❌ [Error] An unknown error has occurred.

majd commented 2 years ago

Does running the tool with the --log-level debug flag provide any useful message about the failure?

sbakhour commented 2 years ago

This is so funny because I tried to re-authenticate afterwards and it was successful without requesting a 2FA. I will try the --log-level debug when it gets reproduced and keep you updated. So far I am able to authenticate without 2FA.

sbbakhou@88665a23f3f2 ~ % ipatool auth login --log-level debug ==> ⚠️ [Warning] Enter Apple ID email: ==> ⚠️ [Warning] Enter Apple ID password: ==> 🛠 [Debug] Creating HTTP client... ==> 🛠 [Debug] Creating App Store client... ==> ℹ️ [Info] Authenticating with the App Store... ==> ℹ️ [Info] Authenticated as 'Sam Mobilesec'.

majd commented 2 years ago

Is this issue still relevant?

sbakhour commented 2 years ago

Hello Majd, I didn't experience this anymore with the tool. I am going to close the issue, thank you so much for your time.

danilobjr commented 2 years ago

@majd I'm facing this issue.

Screen Shot 2022-09-07 at 15 45 54

Note: I generated 2FA code manually in System Preferences.

I've also trie the solution presented here https://github.com/majd/ipatool/issues/30#issuecomment-997753037, but I think that the ipatool API has changed. Output:

Screen Shot 2022-09-07 at 16 00 21

Any thoughts? Thanks in advance.