Apple iOS Two-factor Authentication: "Invalid code"

When building the iOS version I get the “Two-factor Authentication” call. I enter the 6 digits, but the code is never correctly recognized. Entering 6 digits is not that complicated, so I assume I got them right. The build is successful for Android.

$ expo build:ios
✔ Choose the build type you would like: › archive

Checking if there is a build in progress...

Accessing credentials for xyz in project eu.project
✔ Do you have access to the Apple account that will be used for submitting this app to the App Store? … yes

› Log in to your Apple Developer account to continue
✔ Apple ID: … xyz@domain.tld
› Using password for xyz@domain.tld from your local Keychain
  Learn more.
✔ Logged in, verify your Apple account to continue
Two-factor Authentication (6 digit code) is enabled for xyz@domain.tld. Learn more.

✔ Please enter the 6 digit code you received at +xy ••• •••••••z: … 123456
✖ Invalid code
Two-factor Authentication (6 digit code) is enabled for xyz@domain.tld. Learn more.

✔ Please enter the 6 digit code you received at +xy ••• •••••••z: … 123456
✖ Invalid code

Anyone has the same issue? Any work-around?

expo-cli 4.4.3, sdk-41.0.0, iOS

have you tried logging into https://appstoreconnect.apple.com/login using 2FA?

@charliecruzan I can log into App Store Connect with username/password, without 2FA.

strange. 2fa is required as of march: Two-factor Authentication - Account Management - Support - Apple Developer

Starting in March 2021, two-factor authentication or two-step verification will be required for all users to sign in to App Store Connect.

maybe try setting it up if you haven’t already

I just tried a login to the Apple website, this time it called me with a PIN. It worked.

Then I tried expo build:ios, same login, got a call, response “Invalid code”.

Only difference: first call was in my local language, second one in English.

Strange.

I updated expo-cli to 4.4.4 and changed 2FA to SMS, now it works :slight_smile:

Hi im having the same problem. Already tried everything. Please help. I receive the code from the apple call but the:

“Invalid code
Two-factor Authentication (6 digit code)”

@nuthx Try updating the expo-cli and if this doesn’t help, add a mobile number for SMS :slight_smile:

npm install -g expo-cli - or - npm update -g expo-cli

YEAH! I did it! problem resolved. As you said, add a mobile number for SMS. That was the trick.
Thanks

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.