eas-cli icon indicating copy to clipboard operation
eas-cli copied to clipboard

2FA with Apple fails

Open rauldeheer opened this issue 1 year ago • 9 comments

Build/Submit details page URL

No response

Summary

Whenever I run the command eas build --platform ios, it prompts me to authenticate with Apple. I confirm, and since my credentials are already saved in the local keychain, it proceeds to the 2FA step.

Initially, I didn't receive any text message — the same thing happens when I try logging into the Apple Developer Portal directly. I then selected the “Call me instead” option, which worked. Now, whenever I run the same eas build command, I do receive a call, but the verification code I enter is always rejected as incorrect.

I'm not sure why this is happening — this process used to work without any issues.

Managed or bare?

Managed

Environment

expo-env-info 1.2.2 environment info:
    System:
      OS: macOS 14.6.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 22.9.0 - ~/.nvm/versions/node/v22.9.0/bin/node
      npm: 10.8.3 - ~/.nvm/versions/node/v22.9.0/bin/npm
    Managers:
      CocoaPods: 1.16.2 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1
    IDEs:
      Android Studio: 2023.3 AI-233.14808.21.2331.11842104
      Xcode: 16.1/16B40 - /usr/bin/xcodebuild
    npmPackages:
      @expo/metro-config: ~0.19.0 => 0.19.12 
      expo: ^52.0.39 => 52.0.39 
      react: 18.3.1 => 18.3.1 
      react-native: 0.76.7 => 0.76.7 
    npmGlobalPackages:
      eas-cli: 16.0.1
    Expo Workflow: managed

Error output

No response

Reproducible demo or steps to reproduce from a blank project

Just try to publish an update

rauldeheer avatar Mar 25 '25 15:03 rauldeheer

Same here

hassanzeaiter avatar Mar 25 '25 20:03 hassanzeaiter

same for me. it used to work and now it's not

Geo2000 avatar Mar 26 '25 09:03 Geo2000

on my end with eas-cli (eas-cli/16.1.0 darwin-arm64 node-v22.11.0) I didn't receive any messages.

workaround was to try to login to app store connect, select the option to send the message from here and paste the code for eas

adblanc avatar Mar 27 '25 07:03 adblanc

@adblanc can you be more specific about your workaround? Thanks.

rauldeheer avatar Mar 27 '25 10:03 rauldeheer

I was forced to add another account (that's attached to a device) to my App Store Connect profile. I was not able to make this work at all. It seems that accounts without devices linked to them, don't work at all.

rauldeheer avatar Mar 27 '25 10:03 rauldeheer

This might be a duplicate of https://github.com/expo/eas-cli/issues/2926 . There are some workarounds there.

allxie avatar Mar 27 '25 22:03 allxie

@rauldeheer The workaround that @adblanc is describing (which worked for me) was:

  1. run the command prompting sign-in with eas-cli
  2. sign in in the CLI with apple id/password
  3. go to https://account.apple.com/sign-in then sign in with apple id/password
  4. when prompted for the 2fa sms code, use the code in the CLI instead

It's kinda crazy/concerning that this even works. I would assume that 2fa requests are relevant to the specific login attempt that created it, but that is not the case!

6TELOIV avatar Mar 31 '25 20:03 6TELOIV

@6TELOIV Ran into this issue as well. This workaround does the trick. Indeed amazed this works..

rnnyrk avatar Apr 02 '25 19:04 rnnyrk

Workaround: I needed to sign in with my Apple ID on macOS. When logging in, it prompted me to choose a verification method (device or SMS). I chose Device, received a code, and used it to complete the verification.

Hope it helps anyone else!

agostinhocbneto avatar Jan 22 '26 21:01 agostinhocbneto