XcodesOrg / xcodes

The best command-line tool to install and switch between multiple versions of Xcode.
MIT License
3.6k stars 120 forks source link

Non-specific 2FA failure #251

Open pbh-stripe opened 1 year ago

pbh-stripe commented 1 year ago

Thanks for making this tool. I attempted to use it to install xcode 14.1 but had some kind of auth issue. After entering email and password, it prompted for a six digit code. That did pop up on this laptop, but after I entered it and hit enter I got some kind of low-level error:

  $ xcodes install 14.1
  Apple ID: [my email]
  Apple ID Password: [my password]
  Two-factor authentication is enabled for this account.

  Enter "sms" without quotes to exit this prompt and choose a phone number to send an SMS security code to.
  Enter the 6 digit code from one of your trusted devices: [six digit code]
  Invalid HTTP response (400) for https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode.
  Invalid HTTP response (400) for https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode.

I'm at a loss for how to help debug this, but I'm happy to try suggestions. Thanks in advance for any help.

MattKiazyk commented 1 year ago

400 usually indicates wrong code.. did you try multiple times?

pbh-stripe commented 1 year ago

Yes, three times. I could see the terminal and the popup with the code side-by-side, so I'm sure there were no typos.

foux commented 1 year ago

I've got the same issue, and I'm also sur I've got no mistakes in my 2FA

foux commented 1 year ago

More informations : it works when receiving the 2FA code via an approved device. But if you've got no approved device and you directly receive the 2FA code by phone call/SMS, then you get the 400 error

artem-kosenko commented 1 year ago

2FA code works from terminal, but how to automate this with ansible? I'm able to greb the questions and enter the credentials for local user and set the apple id credential in environment variables, but 2FA brake all automation. Is the any way to install xcode without the 2FA verification? Or is the any way to grep this code in the script?

kikmon commented 1 year ago

Bump. I just got the same issue, and I'm glad to see I'm not the only one. Did anyone found a way to automate the execution of xcodes through ansible when 2FA is activated ? Is there a way to create an account to use xcodes that doesn't require 2FA for automation purposes ?