ipatool icon indicating copy to clipboard operation
ipatool copied to clipboard

Login failing after 2FA

Open smj0x opened this issue 4 months ago • 8 comments

What happened?

Output:

% ipatool auth login --email [email protected] --password Example
9:02PM INF enter 2FA code:
123456
9:03PM ERR error="something went wrong" success=false

Output with verbrose:

ipatool auth login --verbose --email [email protected] --password Example
9:02PM INF enter 2FA code:
123456
9:07PM DBG logging in authCode=<nil> [email protected] password=Example
9:07PM DBG error="something went wrong" metadata={"Data":{"Account":{"Address":{"FirstName":"","LastName":""},"Email":""},"CustomerMessage":"","DirectoryServicesID":"","FailureType":"5005","PasswordToken":""},"Headers":{"Access-Control-Allow-Origin":"*","Apple-Originating-System":"MZFinance","Apple-Seq":"0.1","Apple-Timing-App":"366 ms","Apple-Tk":"false","B3":"XX-d5e0d7aac09b3522","Cache-Control":"private; no-cache; no-store; no-transform; must-revalidate; max-age=0","Connection":"keep-alive","Date":"Thu, 07 Aug 2025 15:37:04 GMT","Edge-Control":"no-store; cache-maxage=0","Expires":"Thu, 07 Aug 2025 15:37:04 GMT","Itspod":"36","Pod":"36","Pragma":"no-cache","Server":"Apple","Set-Cookie":"hsaccnt=1; version=\"1\"; path=/WebObjects; domain=.apple.com; mz_at0_fr-17344604950==; version=\"1\"; max-age=2592000; expires=Sat, 06-Sep-2025 15:37:04 GMT; path=/; domain=.apple.com; HttpOnly; mz_at0_fr==; version=\"1\"; max-age=2592000; expires=Sat, 06-Sep-2025 15:37:04 GMT; path=/; domain=.apple.com; HttpOnly; mz_at_ssl-17344604950=/gJ9gIwYwqR0/nqA=; version=\"1\"; max-age=63072000; expires=Sat, 07-Aug-2027 15:37:04 GMT; path=/; domain=.apple.com; secure; HttpOnly; X-Dsid=; version=\"1\"; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/; domain=.volume.itunes.apple.com; X-Dsid=; version=\"1\"; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/; domain=.vpp.itunes.apple.com; X-Token=; version=\"1\"; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/; domain=.volume.itunes.apple.com; secure; X-Token=; version=\"1\"; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/; domain=.vpp.itunes.apple.com; secure; pldfltcid=; version=\"1\"; expires=Fri, 06-Feb-2026 03:37:04 GMT; path=/; domain=.apple.com; tv-pldfltcid=; version=\"1\"; expires=Fri, 06-Feb-2026 03:37:04 GMT; path=/; domain=.apple.com; isPpuOptOut=; version=\"1\"; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/; domain=.apple.com; wosid=RWOzW3sDpha5ffubSHBh5w; version=\"1\"; path=/WebObjects/MZFinance.woa; domain=.apple.com; secure; HttpOnly; woinst=-1; version=\"1\"; path=/WebObjects/MZFinance.woa; domain=.apple.com; secure; HttpOnly; session-store-id=XXX; version=\"1\"; expires=Thu, 07-Aug-2025 16:07:04 GMT; path=/WebObjects; domain=.apple.com; secure; itspod=36; version=\"1\"; expires=Sun, 07-Sep-2025 15:37:04 GMT; path=/; domain=.apple.com; mzf_in=3360247; version=\"1\"; path=/WebObjects; domain=.apple.com; secure; HttpOnly; mzf_dr=0; version=\"1\"; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/WebObjects; domain=.apple.com","Strict-Transport-Security":"max-age=31536000; includeSubdomains","X-Apple-Application-Instance":"3360247","X-Apple-Application-Site":"MR22","X-Apple-Jingle-Correlation-Key":"XX","X-Apple-Lokamai-No-Cache":"true","X-Apple-Orig-Url":"https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate","X-Apple-Request-Uuid":"af58b71f-8a10-2d2a-a7ee-a7a1f491d14f","X-Apple-Translated-Wo-Url":"/WebObjects/MZFinance.woa/wa/authenticate","X-B3-Spanid":"XX","X-B3-Traceid":"af58b71f8a102d2aa7eea7a1f491d14f","X-Content-Type-Options":"nosniff","X-Daiquiri-Instance":"daiquiri:14236001:XX-qukt05050701:7987:25RELEASE91:daiquiri-amp-commerce-legacy-int-001-mr; daiquiri:X:mr55p00it-qukt01020301:7987:25RELEASE91:daiquiri-amp-commerce-pci-ext-001-mr","X-Frame-Options":"SAMEORIGIN","X-Responding-Instance":"MZFinance:3360247:::","X-Set-Apple-Store-Front":"143479-2,34","X-Webobjects-Loadaverage":"99","X-Xss-Protection":"1; mode=block"},"StatusCode":200}
9:07PM ERR error="something went wrong" success=fal

Version

2.0.2

Relevant log output


smj0x avatar Aug 07 '25 15:08 smj0x

I have the same error. Need help here ,please

pradeepvizz avatar Aug 09 '25 12:08 pradeepvizz

I’m facing the same problem. Has anyone found a solution for it? I'm using the version 2.2.0.

hugo-lsilva avatar Aug 22 '25 20:08 hugo-lsilva

Yes this is resolved for me. The MFA code has to be generated from an apple device before we execute he login and be appended to the password.

Example: p@$$word123456

Here 123456 is the MFA code.

Hope it helps

I’m facing the same problem. Has anyone found a solution for it? I'm using the version 2.2.0.

pradeepvizz avatar Aug 23 '25 01:08 pradeepvizz

Yes this is resolved for me. The MFA code has to be generated from an apple device before we execute he login and be appended to the password.

Example: p@$$word123456

Here 123456 is the MFA code.

Hope it helps

I’m facing the same problem. Has anyone found a solution for it? I'm using the version 2.2.0.

Unfortunately, that didn’t solve it for me. I tried two approaches:

$ ipatool auth login -e [email protected] --verbose 6:07PM INF enter password: 6:08PM DBG logging in authCode= [email protected] password=[password][2fa code]

$ ipatool auth login -e [email protected] --auth-code [2fa code] --verbose 6:08PM INF enter password: 6:09PM DBG logging in authCode=[2fa code] [email protected] password=[password][2fa code]

Output:

6:10PM ERR error="something went wrong" success=false

hugo-lsilva avatar Aug 25 '25 21:08 hugo-lsilva

"The MFA code has to be generated from an apple device before we execute he login and be appended to the password."

I have not got an Apple device. Apple only call me on a fixed line number.

How can you generate a 2FK code before the event?

supersophie avatar Aug 28 '25 17:08 supersophie

has anyone encountered ipatool losing authentication, and requiring to re-auth into iTunes store again after some time (even though it had been signed into iTunes Store before and auth was never revoked manually)?

DBG error="received error: Sign In to the iTunes Store" metadata={"Data":{"CustomerMessage":"Sign In to the iTunes Store","FailureType":"2042","Items":null}, ...

is it an expected behavior?

gitevedev avatar Sep 10 '25 14:09 gitevedev

5005 indicates that you haven't used the account on the appstore prior (usually this is when it forces you to add a payment method or whatever) so third-party stuff won't log in

adrievx avatar Oct 16 '25 11:10 adrievx

@adrievx thanks! I'll log in to the App Store online now and see if it works.

Buggem avatar Nov 02 '25 02:11 Buggem