Two-factor authentication for Apple ID / iTunes Connect TestFlight deploy

If you can share more about the issue @fabrygio we can also try to debug it (e.g. send the full log to us in email or just copy paste the whole step log here).

Actually I think this error is something new, never seen it before, so can you please do this? Either send the build URL in email / through the onsite chat or copy paste the step’s log here and we’ll check it ASAP!

My bad. I was using an old version of Fastlane

1 Like

Ahh, indeed, if you use any fastlane tool/command which has to communicate with the iTunes Connect server you should always use the latest fastlane version, as iTC doesn’t have a public API and they do change the API from time to time, and when that happens only the updated fastlane versions will work / will have the proper, updated API calls.

@Shiro Were you able to find a workaround? I’m having the same issue here too. I’m stuck at

This Bitrise.io built in Apple Dev Portal auth now works with the fastlane step too: https://blog.bitrise.io/app-store-connect-2fa-solved-on-bitrise

With this you can connect your Apple Dev Portal account to your Bitrise.io account and then the official Bitrise fastlane step will use that connection to generate the fastlane specific session cookie automatically! :rocket:

2 Likes

Hi, I have enabled this option, and when running the build immediately after connecting my account everything work, awesome.

Unfortunately, it stops working after some short period of inactivity, i’m not sure how long but I’m guessing 24 hours. After that I see this error in our build:

If i go into the integration settings page, it shows our Apple 2fa is valid for another 30 days, if i I click to re-authenticate, despite it saying the code is still valid, the next build works! But then i have todo this again the next day.

I was searching through the fastlane docs, but can’t figure out why i have to re-auth my 2fa code every 24 hours. We are running on the latest fastlane version. Any ideas?

Thanks!

Hy there, The website is kind of hardcoded on this, and apple tends to change the validity of the session cookies pretty frequently. but yeah, running a build daily that in a way uses the apple account, (like with the iOS auto provision step) can manage this issue I think :thinking:

Hi, do I have to renew the 2FA every 30 days in the Account Settings page?

And will it only work if my location is in the US?

Hi @tolentinokas! Yes, unfortunately 2FA session expire after 30 days, but no, they can be concluded from anywhere around the world :slight_smile: The region-based authentication requirement was specifically for an ā€˜older’ fastlane process.