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

Still having Apple Authentication error

Open alleyhector opened this issue 1 year ago • 43 comments

Build/Submit details page URL

https://expo.dev/accounts/alleyhector1981/projects/astrosnax

Summary

I'm still receiving the same authentication error from closed issue #2698 indicating that Apple cannot send verification to my phone number. I don't have an Apple device to use that workaround.

Authentication with Apple Developer Portal failed!
Received an internal server error from Apple's App Store Connect / Developer Portal servers, please try again later. Apple service errors:
- Verification codes can’t be sent to this phone number at this time. Please try again later.
If you encounter persistent issues with Apple 2FA SMS authentication, you can try using these workarounds: https://expo.fyi/apple-2fa-sms-issues-workaround.md.
    Error: build command failed.

Managed or bare?

Managed

Environment

Enabled experimental React Native Directory checks. Unset the EXPO_DOCTOR_ENABLE_DIRECTORY_CHECK environment variable to disable this check. ✔ Check package.json for common issues ✔ Check Expo config for common issues ✔ Check native tooling versions ✔ Check if the project meets version requirements for submission to app stores ✔ Check for common project setup issues ✔ Check dependencies for packages that should not be installed directly ✔ Check for app config fields that may not be synced in a non-CNG project ✔ Check for issues with Metro config ✔ Check npm/ yarn versions ✖ Validate packages against React Native Directory package metadata ✔ Check Expo config (app.json/ app.config.js) schema ✔ Check for legacy global CLI installed locally ✔ Check that native modules do not use incompatible support packages ✔ Check that packages match versions required by installed Expo SDK ✔ Check that native modules use compatible support package versions for installed Expo SDK

Detailed check results:

The following issues were found when validating your dependencies against React Native Directory: No metadata available: @apollo/client, graphql, react-native-fit-image Advice:

  • Update React Native Directory to include metadata for unknown packages. Alternatively, set expo.doctor.reactNativeDirectoryCheck.listUnknownPackages in package.json to false to skip warnings about packages with no metadata, if the warning is not relevant.

Error output

h [Error]: Received an internal server error from Apple's App Store Connect / Developer Portal servers, please try again later. Apple service errors:
- Verification codes can’t be sent to this phone number at this time. Please try again later.
If you encounter persistent issues with Apple 2FA SMS authentication, you can try using these workarounds: https://expo.fyi/apple-2fa-sms-issues-workaround.md.
    at t.getAppleResponseError (/Users/alleyhector/.npm-global/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:857201)
    at block (/Users/alleyhector/.npm-global/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:865249)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async O (/Users/alleyhector/.npm-global/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:865761)
    at async I (/Users/alleyhector/.npm-global/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:864614)
    at async t.requestAsync (/Users/alleyhector/.npm-global/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:863150)
    at async t.idmsaRequestAsync (/Users/alleyhector/.npm-global/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:736419)
    at async t.requestAuthAsync (/Users/alleyhector/.npm-global/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:751216)
    at async t.handleTwoFactorAuthentication (/Users/alleyhector/.npm-global/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:745676)
    at async Object.w [as loginWithUserCredentialsAsync] (/Users/alleyhector/.npm-global/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:728315) {
  response: {
    status: 500,
    statusText: '',
    headers: {
      server: 'Apple',
      date: 'Wed, 11 Dec 2024 20:27:56 GMT',
      'content-type': 'application/json;charset=UTF-8',
      'transfer-encoding': 'chunked',
      connection: 'keep-alive',
      'x-apple-i-request-id': '67a13960-b7fe-11ef-a222-a1c1c4d4a179',
      'x-frame-options': 'ALLOW-FROM https://itunesconnect.apple.com',
      'x-content-type-options': 'nosniff',
      'x-xss-protection': '1; mode=block',
      'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
      'content-security-policy': "default-src 'self' ; child-src blob: ; connect-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://webcourier.sandbox.push.apple.com https://xp-qa.apple.com ; font-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ; frame-src 'self' https://appleid.apple.com https://gsa.apple.com https://account.apple.com ; img-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://*.mzstatic.com data: https://*.apple.com ; media-src data: ; object-src 'none' ; script-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ; style-src 'unsafe-inline' 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ;  frame-ancestors 'self' https://itunesconnect.apple.com;",
      'referrer-policy': 'origin',
      'x-buildversion': 'R3',
      scnt: 'AAAA-jRDQ0ZBQThCMjAwQUI5RTQzODFFRDY2RDk5REI2ODFBNjA5RjM1OTNGNjM3QzQwQjMyMEJENTA5RTRGMTMyMzdDNThFOEQyNDExQ0E5MDM3MkM0RkRBMTE2REI0MDQ3MzM2ODUxMkExQzk5QjMyMUJDRTcwOTcxMEFBRUFERUEwMjBENjIzMzAzQTNBREVBOTc2N0VCNDlDOEU3N0E1QzJCNkJGMEE5MTE5QTNBOERCQzQ5NkE3MzNCNDY3MjUxNkY1OUVCNjMyRDAxQ0IyQTQ5NzRENEIyRkY5QzBCRjBEN0MyNzlDNDcxODNEQjA4RXwzAAABk7d14IjU6moq9eX3pgDxf0yBQfdpEhbUjTkO8bwSXGNWjaG0-sqfgaUZFvnxABU0CfzqVmRHSeHH-LG_cSd06AHnyEe-G61Bm88gaCnJVdW_GpFVzw',
      'set-cookie': [Array],
      pragma: 'no-cache',
      expires: 'Thu, 01 Jan 1970 00:00:00 GMT',
      'cache-control': 'no-cache, no-store, no-store',
      'x-apple-ak-auth-type': 'hsa2',
      'x-apple-id-session-id': '4CCFAA8B200AB9E4381ED66D99DB681A609F3593F637C40B320BD509E4F13237C58E8D2411CA90372C4FDA116DB40473368512A1C99B321BCE709710AAEADEA020D623303A3ADEA9767EB49C8E77A5C2B6BF0A9119A3A8DBC496A733B4672516F59EB632D01CB2A4974D4B2FF9C0BF0D7C279C47183DB08E',
      'x-apple-auth-attributes': 'QaepT85Dc/9FaC4+CkgAFTQKJ679UA==',
      'x-apple-id-account-country': 'USA',
      vary: 'accept-encoding',
      'content-language': 'en-US-x-lvariant-USA'
    },
    config: {
      url: 'https://idmsa.apple.com/appleauth/auth',
      method: 'get',
      headers: [Object],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      withCredentials: true,
      adapter: [Function (anonymous)],
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      jar: [M],
      maxRedirects: 0,
      data: undefined,
      baseURL: 'https://idmsa.apple.com/',
      validateStatus: [Function: validateStatus]
    },
    request: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: true,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: true,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: true,
      _header: 'GET /appleauth/auth HTTP/1.1\r\n' +
        'Accept: application/json\r\n' +
        'scnt: AAAA-jRDQ0ZBQThCMjAwQUI5RTQzODFFRDY2RDk5REI2ODFBNjA5RjM1OTNGNjM3QzQwQjMyMEJENTA5RTRGMTMyMzdDNThFOEQyNDExQ0E5MDM3MkM0RkRBMTE2REI0MDQ3MzM2ODUxMkExQzk5QjMyMUJDRTcwOTcxMEFBRUFERUEwMjBENjIzMzAzQTNBREVBOTc2N0VCNDlDOEU3N0E1QzJCNkJGMEE5MTE5QTNBOERCQzQ5NkE3MzNCNDY3MjUxNkY1OUVCNjMyRDAxQ0IyQTQ5NzRENEIyRkY5QzBCRjBEN0MyNzlDNDcxODNEQjA4RXwyAAABk7d13wMag-_MDJ9TErllr0QRoJAEOLQMCt9y8JpwOGYzFGuSzVZ3ERwCoGD-ABU0CeW6MX8p4DjgcNFGflhWqWG_d9eQt9Q_Elhvtim9rRSYzPjTYg\r\n' +
        'X-Apple-Id-Session-Id: 4CCFAA8B200AB9E4381ED66D99DB681A609F3593F637C40B320BD509E4F13237C58E8D2411CA90372C4FDA116DB40473368512A1C99B321BCE709710AAEADEA020D623303A3ADEA9767EB49C8E77A5C2B6BF0A9119A3A8DBC496A733B4672516F59EB632D01CB2A4974D4B2FF9C0BF0D7C279C47183DB08E\r\n' +
        'X-Apple-Widget-Key: e0b80c3bf78523bfe80974d320935bfa30add02e1bff88ec2166c6bd5a706c42\r\n' +
        'Cookie: dslang=US-EN; site=USA; aasp=4CCFAA8B200AB9E4381ED66D99DB681A609F3593F637C40B320BD509E4F13237C58E8D2411CA90372C4FDA116DB40473368512A1C99B321BCE709710AAEADEA020D623303A3ADEA9767EB49C8E77A5C2B6BF0A9119A3A8DBC496A733B4672516F59EB632D01CB2A4974D4B2FF9C0BF0D7C279C47183DB08E; acn01=dK6dXfMv2U5sV9Y22a1DH6MpAnAnA2sYEbZMZ6MM/bAr6rJU9QAVNAn0ZXkk\r\n' +
        'User-Agent: axios/0.20.0\r\n' +
        'Host: idmsa.apple.com\r\n' +
        'Connection: keep-alive\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      joinDuplicateHeaders: undefined,
      path: '/appleauth/auth',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: true,
      host: 'idmsa.apple.com',
      protocol: 'https:',
      [Symbol(shapeMode)]: false,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kChunkedBuffer)]: [],
      [Symbol(kChunkedLength)]: 0,
      [Symbol(kSocket)]: [TLSSocket],
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(errored)]: null,
      [Symbol(kHighWaterMark)]: 65536,
      [Symbol(kRejectNonStandardBodyWrites)]: false,
      [Symbol(kUniqueHeaders)]: null
    },
    data: {
      phoneNumber: [Object],
      securityCode: [Object],
      mode: 'voice',
      type: 'verification',
      authenticationType: 'hsa2',
      noTrustedDevices: true,
      autoVerified: false,
      showAutoVerificationUI: false,
      hideSendSMSCodeOption: false,
      supervisedChangePasswordFlow: false,
      enableNonFTEU: false,
      hsa2Account: true,
      restrictedAccount: false,
      supportsRecovery: true,
      managedAccount: false,
      serviceErrors: [Array]
    }
  }
}
    Error: build command failed.

Reproducible demo or steps to reproduce from a blank project

This happens when either running eas build or eas submit though the debug output for eas submit is just the Apple security related above.

alleyhector avatar Dec 11 '24 20:12 alleyhector

I opened this issue to update the workaround.md https://github.com/expo/fyi/issues/187 In my case: The issue seems to be due to the fact that I have multiple accounts with Apple, one account email is the user account on my Mac and is not the same as the developer account email at the company I am working for. This was resolved for me by signing out of my Apple Account in System Settings and signing in to the developer account. I am filing an issue to update the workaround.md file and help other developers who may be experiencing similar problems and so that expo team can update the eas-cli so that developers do not have to sign out of their personal Mac account to use a different developer account.

tinkerer avatar Dec 11 '24 22:12 tinkerer

Sorry I missed your issue from yesterday. I do think I'm having the same one so we can close this if its a duplicate. I let Expo folks decide.

And actually I was able to find an iOS device to log into but it would be nice to have the SMS fixed so you don't have to use a work specific device.

Thanks!

alleyhector avatar Dec 11 '24 23:12 alleyhector

Tried the workaround still no luck :( Still facing the same issue. currently having eas-cli/14.1.0 darwin-arm64 node-v20.17.0

umangloria avatar Dec 12 '24 14:12 umangloria

Quick reminder that you can use a mac as your Apple device too. Again, we were able to reproduce this error and fixed against the repro so we no longer have any ability to test against the problem and it is seemingly fixed. I'd recommend clearing your local caches and trying again. https://github.com/expo/eas-cli/issues/2698#issuecomment-2532459498

EvanBacon avatar Dec 12 '24 20:12 EvanBacon

Quick reminder that you can use a mac as your Apple device too. Again, we were able to reproduce this error and fixed against the repro so we no longer have any ability to test against the problem and it is seemingly fixed. I'd recommend clearing your local caches and trying again. #2698 (comment)

Do you mean fixed with a device or fixed with SMS. Just wanted to clarify because the SMS still doesn't work, although the workaround does.

alleyhector avatar Dec 12 '24 21:12 alleyhector

Quick reminder that you can use a mac as your Apple device too. Again, we were able to reproduce this error and fixed against the repro so we no longer have any ability to test against the problem and it is seemingly fixed. I'd recommend clearing your local caches and trying again. #2698 (comment)

After clearing the caches and using 14.1.0, I'm unable to sign in with SMS 2FA. I have multiple devices set up for device 2FA, but eas cli never asks for it. I ran EXPO_NO_KEYCHAIN=1 eas build and it made me sign in all over again but still went right for the SMS 2FA. I haven't found a way to get it to try device 2FA and there is no way to disable SMS.

EDIT: It finally updated. But the device 2FA is far less preferred.

tscans avatar Dec 13 '24 02:12 tscans

Tried with both SMS an device code and it is till the same.

umangloria avatar Dec 13 '24 04:12 umangloria

Yup this was working now it's back

arapocket avatar Dec 13 '24 17:12 arapocket

I'm still having this issue as well, but @tinkerer's workaround helped me get up and running again. Same situation and seems easy to reproduce — I'm signed into Apple with my personal account on my computer, but am using a different Apple account to build my project. I'm never asked to select a verification method, even after deleting ~/.app-store.

If I sign out of Apple (from System Settings) and sign in as the same profile I want to build the project with, it works as normal and prompts me for setting a verification method.

The other workaround that has worked is using the --non-interactive flag, but that also is not ideal.

If I go into XCode, I am signed into both Apple accounts there as well, but the CLI still doesn't work unless the account on the device matches the account building the project.

evanheisler avatar Dec 13 '24 17:12 evanheisler

I opened this issue to update the workaround.md expo/fyi#187 In my case: The issue seems to be due to the fact that I have multiple accounts with Apple, one account email is the user account on my Mac and is not the same as the developer account email at the company I am working for. This was resolved for me by signing out of my Apple Account in System Settings and signing in to the developer account. I am filing an issue to update the workaround.md file and help other developers who may be experiencing similar problems and so that expo team can update the eas-cli so that developers do not have to sign out of their personal Mac account to use a different developer account.

this worked for me thanks

arapocket avatar Dec 13 '24 17:12 arapocket

I opened this issue to update the workaround.md expo/fyi#187 In my case: The issue seems to be due to the fact that I have multiple accounts with Apple, one account email is the user account on my Mac and is not the same as the developer account email at the company I am working for. This was resolved for me by signing out of my Apple Account in System Settings and signing in to the developer account. I am filing an issue to update the workaround.md file and help other developers who may be experiencing similar problems and so that expo team can update the eas-cli so that developers do not have to sign out of their personal Mac account to use a different developer account.

This worked for me.

I had to signed out of my personal Apple account, log in into my Apple work account, and the build works fine as expected. After that, I tried to logout of the work account, and re-login into my personal account on the same machine. Until now, build works as expected. I guess they need just the initial login verification? hoping EAS team find a more sustainable approach to this problem as it has been cropped up time and time again.

apitlekays avatar Dec 16 '24 04:12 apitlekays

Issue still persists on my end.

I have updated eas cli to 14.2.0 and cleared caches.

There was another release over the weekend of 12/13 , but I still get the error. Expo seriously needs to get it together here. This should have been resolved 3 versions ago!

Bay102 avatar Dec 16 '24 17:12 Bay102

this just started happening to me, never saw this issue once and did a build successfully just this past friday. i cannot do the workaround because i do not own any apple devices besides the ipad received from my customer which i use to test the app, and it appears the apple account linked to it is not able to be changed. is there really not anything else i can do? can i not manually pull some key or something right through app store connect in my browser or anything like that?

joeskyforged avatar Dec 16 '24 19:12 joeskyforged

I'm having the same issue here. Not sure what to do. Workaround doesn't work.

dougdiego avatar Dec 17 '24 05:12 dougdiego

SMS 2FA was fixed for the repro we had internally after 14.0.3 landed. It has worked fine for this account since then. If you still see this issue, it would be helpful to diff the headers/payload that gets sent to the failing endpoint through EAS CLI and Apple's developer portal auth and list all of the differences you see (without sensitive data) to give us something to work with. This API is undocumented and it sometimes gets suddenly changed without any warnings. We try to do what we can to make it work for everybody, but without more details, it is really hard for us to move forward with this. As I said we had repro internally and we were able to fix SMS 2FA for the affected account we got access to. So having more context and specifics about differences in requests that are failing for you vs succeeding ones would be helpful.

szdziedzic avatar Dec 17 '24 10:12 szdziedzic

Also experiencing this. Went through the steps in https://github.com/expo/eas-cli/issues/2698#issuecomment-2532459498, but no luck.

Next step is logging in with my work id on my computer

toppsdown avatar Dec 17 '24 16:12 toppsdown

I'm also experiencing this issue still. Not sure if this is what you're looking for, but I logged in with my browser at http://idmsa.apple.com (redirects to account.apple.com) and compared the headers to the expo cli. They're quite different, especially since the browser accepts text and the cli accepts json, but here you go:

CLI https://idmsa.apple.com/appleauth/auth - (Response: 500) Accept: application/json scnt: AAAA-jUxME... X-Apple-Id-Session-Id: 510E... X-Apple-Widget-Key: e0b... Cookie: dslang=US-EN; site=USA; aasp=510...; acn01=fwYVE... User-Agent: axios/0.20.0 Host: idmsa.apple.com Connection: close

Browser https://idmsa.apple.com/appleauth/auth - (Response: 200) Accept: text/html Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Connection: keep-alive Content-Type: application/json Cookie: dslang=US-EN; site=USA; aa=1B8...; aasp=6CE8...; dawsp=EAAC...; dc=st; s_cc=true; s_fid=5C7A...; s_sq=%5B%5BB%5D%5D; s_vi=[CS]v1|3....[CE]; s_ppv=acs%253A...; s_ppvl=%5B%5BB%5D%5D; itctx=eyJjc....; at_check=true; dssf=1; dssid2=fd7....; nn-user-journey=%7B%22val...; XID=1bb...; itcdq=0; DES55...=HSA...; POD=us~en; as_pcts=AXpP...; geo=US; as_sfa=Mnx1... Priority: u=3, i Referer: https://idmsa.apple.com/ scnt: AAAA-jZDRT... Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Safari/605.1.15 X-Apple-Auth-Attributes: qkJ7S... X-Apple-Domain-Id: 11 X-Apple-Frame-Id: auth-mo... X-Apple-I-FD-Client-Info: {"U":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Safari/605.1.15","L":"en-US","Z":"GMT-05:00","V":"1.1","F":"7ta44..."} X-Apple-ID-Session-Id: 6CE8... X-Apple-OAuth-Client-Id: af113... X-Apple-OAuth-Client-Type: firstPartyAuth X-Apple-OAuth-Redirect-URI: https://account.apple.com X-Apple-OAuth-Response-Mode: web_message X-Apple-OAuth-Response-Type: code X-Apple-OAuth-State: auth-mof... X-Apple-Widget-Key: af113... X-Requested-With: XMLHttpRequest

Happy to troubleshoot further if I left out too much information.

I see the CLI makes 4 requests:

  1. /appleauth/auth/signin?widgetKey=.... - 200
  2. /appleauth/auth/signin/init - 200
  3. /appleauth/auth/signin/complete - 409
  4. /appleauth/auth - 500

The browser makes 2 requests:

  1. /appleauth/auth/signin/complete?isRememberMeEnabled=true - (409, same as CLI)
  2. /appleauth/auth - 200

This may be a red-herring, but when the issue began for me last week, I tried logging into https://idmsa.apple.com/appleauth/auth in the browser and I was getting the exact same error "Verification codes can't be sent...". I contacted Apple Dev Support and sent them the headers, etc, and it was resolved the next day, but the Expo CLI issue remains.

msgerbush avatar Dec 17 '24 16:12 msgerbush

eas-cli/14.2.0 win32-x64 node-v22.12.0

~~I've exhausted everything suggested and to no avail, still unable to submit.~~

After a reboot of my machine (Windows) I was able to submit!

josh7mm avatar Dec 26 '24 15:12 josh7mm

Experienced this for the first time just now, with eas-cli/14.2.0 darwin-arm64 node-v20.12.2, no workarounds or deleting of the appstore dir helped.

Had the different accounts on personal/dev mentioned above. Was able to build after logging into my computer with my dev account instead of personal and selecting 'device' instead of sms when rebuilding.

AtlantisPleb avatar Dec 26 '24 16:12 AtlantisPleb

I got it working after deleting the ~/.app-store folder. In my case, on Windows, C:/Users/[me]/.app-store.

dmathisen avatar Dec 27 '24 06:12 dmathisen