Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo EAS Authentication with Apple Developer Portal failed #2881

Open
burakgokcinarr opened this issue Feb 5, 2025 · 16 comments
Open

Expo EAS Authentication with Apple Developer Portal failed #2881

burakgokcinarr opened this issue Feb 5, 2025 · 16 comments

Comments

@burakgokcinarr
Copy link

burakgokcinarr commented Feb 5, 2025

Build/Submit details page URL

No response

Summary

“Authentication with Apple Developer Portal failed!” error persists when I want to get production build for iOS in eas-cli/15.0.4.

The problem persists even though I do rm -rf ~/.app-store command.

urgent help :)

Managed or bare?

Managed

Environment

expo-env-info 1.2.2 environment info:
System:
OS: macOS 13.7
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.17.0 - /usr/local/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 11.0.0 - /usr/local/bin/npm
Watchman: 2024.11.11.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.16.2 - /Users/burakgokcinar/.rvm/gems/ruby-2.7.6/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2
IDEs:
Android Studio: 2024.2 AI-242.23339.11.2421.12700392
Xcode: 15.2/15C500b - /usr/bin/xcodebuild
npmPackages:
expo: ~52.0.26 => 52.0.26
react: 18.3.1 => 18.3.1
react-native: 0.76.6 => 0.76.6
npmGlobalPackages:
eas-cli: 15.0.4
expo-cli: 6.3.10
Expo Workflow: managed

Error output

Authentication with Apple Developer Portal failed!
Cookie not in this host's domain. Cookie:developer-mdn.apple.com Request:developer.apple.com
Error: build command failed.

Reproducible demo or steps to reproduce from a blank project

eas build --profile production --platform ios

@burakgokcinarr burakgokcinarr added the needs review Issue is ready to be reviewed by a maintainer label Feb 5, 2025
@SanderPeeters
Copy link

I'm afraid I have the same issue

@bols1992
Copy link

Same at my Site

@szdziedzic
Copy link
Member

Can you try to edit the contents of ~/.app-store/auth/apple-developer-portal-domain.json and put

{
  "domain": "https://developer-mdn.apple.com"
}

there?

@szdziedzic szdziedzic added eas build and removed needs review Issue is ready to be reviewed by a maintainer labels Feb 13, 2025
@bajormar
Copy link

Can you try to edit the contents of ~/.app-store/auth/apple-developer-portal-domain.json and put

{
  "domain": "https://developer-mdn.apple.com"
}

there?

Such file already exists with same content.

Tried changing it to https://developer.apple.com, but it gets reverted back to https://developer-mdn.apple.com during eas command

@burakgokcinarr
Copy link
Author

burakgokcinarr commented Feb 14, 2025

I think the problem has something to do with Apple cookies.

While Expo processes the “eas build ..........” commands (for iOS), Apple also provides Apple authentication and cookie management, and as far as I can see, it does user authentication successfully. But expo fails on the cookie management side. (I think there is a changing incompatibility)

This situation urgently needs to be clearly resolved or clarified.

I was temporarily able to provide my “production” output with the help of the following command.

EAS_NO_INTERACTIVE=1 eas build --platform ios

NOTE:

EAS_NO_INTERACTIVE=1 This variable takes EAS Build out of interactive mode and makes the command run completely automatically. This means that Expo tries to continue without asking the user for login credentials or authentication.

Hope this helps.

@thesatishk
Copy link

thesatishk commented Feb 14, 2025

I am having the same issue. Even EAS_NO_INTERACTIVE=1 eas build --platform ios doesn't work for me because the saved credentials were cleared. I wonder if this has something to do with Apple changing Apple Id to Apple Account.

Edit: I found a workaround. I was using an app specific password previously and when I use my actual Apple password, it works.

@bajormar
Copy link

Workaround does not help in my case, because it crashes on Prepare credentials step in EAS

Preparing credentials
Creating keychain
Cannot read properties of undefined (reading 'data')

@burakgokcinarr
Copy link
Author

It is a bit scary that this has been going on for so long. I hope it will be fixed by the expo as soon as possible. What is interesting is that there is no explanation about this or I may not have seen it :)

We love Expo :)

@sterlingwes
Copy link

sterlingwes commented Feb 19, 2025

Yea still broken... had to hastily wire up local credentials instead 😕

Debug output for `eas credentials`

doesn't say much but this is what https://expo.fyi/cryptic-error-eas advised I should do, maybe it'll be helpful as more proof it's broken:

my-project % DEBUG=* eas credentials
  config reading core plugin /Users/uname/.config/yarn/global/node_modules/eas-cli +0ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/eas-cli/package.json +0ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/eas-cli/oclif.manifest.json +0ms
  config:eas-cli using manifest from /Users/uname/.config/yarn/global/node_modules/eas-cli/oclif.manifest.json +0ms
  config reading user plugins pjson /Users/uname/.local/share/eas-cli/package.json +0ms
  config loadJSON /Users/uname/.local/share/eas-cli/package.json +0ms
  config loading plugins [
  '@oclif/plugin-autocomplete',
  '@expo/plugin-help',
  '@expo/plugin-warn-if-update-available'
] +1ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/eas-cli/package.json +0ms
  config reading core plugin /Users/uname/.config/yarn/global/node_modules/@expo/plugin-help +0ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/@expo/plugin-help/package.json +0ms
  config reading core plugin /Users/uname/.config/yarn/global/node_modules/@expo/plugin-warn-if-update-available +0ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/@expo/plugin-warn-if-update-available/package.json +0ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/package.json +0ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/@expo/plugin-help/oclif.manifest.json +0ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/@expo/plugin-warn-if-update-available/oclif.manifest.json +0ms
  config reading core plugin /Users/uname/.config/yarn/global/node_modules/@oclif/plugin-autocomplete +0ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/@oclif/plugin-autocomplete/package.json +0ms
  config loadJSON /Users/uname/.config/yarn/global/node_modules/@oclif/plugin-autocomplete/oclif.manifest.json +0ms
  config:@expo/plugin-warn-if-update-available using manifest from /Users/uname/.config/yarn/global/node_modules/@expo/plugin-warn-if-update-available/oclif.manifest.json +0ms
  config:@expo/plugin-help using manifest from /Users/uname/.config/yarn/global/node_modules/@expo/plugin-help/oclif.manifest.json +0ms
  config:@oclif/plugin-autocomplete using manifest from /Users/uname/.config/yarn/global/node_modules/@oclif/plugin-autocomplete/oclif.manifest.json +0ms
  config config done +3ms
  config start init hook +1ms
  eas:@expo/plugin-warn-if-update-available:hooks:init start (require) /Users/uname/.config/yarn/global/node_modules/@expo/plugin-warn-if-update-available/lib/hooks/init/check-update.js +0ms
  eas:@expo/plugin-warn-if-update-available:hooks:init done +1ms
  config init hook done +18ms
  config runCommand credentials [] +0ms
  config:eas-cli (require) /Users/uname/.config/yarn/global/node_modules/eas-cli/build/commands/credentials/index.js +496ms
  config start prerun hook +467ms
  config prerun hook done +0ms
  eas:credentials init version: @oclif/core@1.26.2 argv: [] +0ms
✔ Select platform › iOS
✔ Which build profile do you want to configure? › store-staging-release-ios-device
✔ Using build profile: store-staging-release-ios-device
If you provide your Apple account credentials we will be able to generate all necessary build credentials and fully validate them.
This is optional, but without Apple account access you will need to provide all the missing values manually and we can only run minimal validation on them.
✔ Do you want to log in to your Apple account? … yes

› Log in to your Apple Developer account to continue
✔ Apple ID: … uname@company.ca
› Restoring session /Users/uname/.app-store/auth/uname@company.ca/cookie
› Team Company Inc. (TEAMID)
› Provider Company Inc. (XXXXXXXXXXXXXXXXXXXXXXXXXXXX)
✔ Logged in Local session
iOS Credentials            
Project                    @myorg/myapp-managed
Bundle Identifier          com.company.mobile
Apple Team                 TEAMID (Company Inc. (Company/Organization))
                           
App Store Connect API Key  
Developer Portal ID        XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Name                       [Expo] EAS Submit
Issuer ID                  XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Roles                      ADMIN
Apple Team                 TEAMID (Company Inc. (Company/Organization))
Updated                    10 months ago
                           
                           
App Store Configuration    
                           
Distribution Certificate   
Serial Number              XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expiration Date            Wed, 11 Feb 2026 19:36:36 EST
Updated                    7 days ago
                           
Provisioning Profile       
Developer Portal ID        XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Status                     active
Expiration                 Sun, 02 Mar 2025 08:44:21 EST
Apple Team                 TEAMID (Company Inc. (Company/Organization))
Updated                    3 months ago
                           
                           
Ad Hoc Configuration       
                           
Distribution Certificate   
                           None assigned yet
                           
Provisioning Profile       
                           None assigned yet
                           
                           
Development Configuration  
                           
Distribution Certificate   
Serial Number              XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expiration Date            Tue, 29 Oct 2024 10:39:59 GMT-0400
Updated                    11 months ago
                           
Provisioning Profile       
                           None assigned yet
                           
✔ What do you want to do? › Build Credentials: Manage everything needed to build your project
iOS Credentials            
Project                    @myorg/myapp-managed
Bundle Identifier          com.company.mobile
Apple Team                 TEAMID (Company Inc. (Company/Organization))
                           
App Store Connect API Key  
Developer Portal ID        XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Name                       [Expo] EAS Submit
Issuer ID                  XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Roles                      ADMIN
Apple Team                 TEAMID (Company Inc. (Company/Organization))
Updated                    10 months ago
                           
                           
App Store Configuration    
                           
Distribution Certificate   
Serial Number              XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expiration Date            Wed, 11 Feb 2026 19:36:36 EST
Updated                    7 days ago
                           
Provisioning Profile       
Developer Portal ID        XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Status                     active
Expiration                 Sun, 02 Mar 2025 08:44:21 EST
Apple Team                 TEAMID (Company Inc. (Company/Organization))
Updated                    3 months ago
                           
                           
Ad Hoc Configuration       
                           
Distribution Certificate   
                           None assigned yet
                           
Provisioning Profile       
                           None assigned yet
                           
                           
Development Configuration  
                           
Distribution Certificate   
Serial Number              XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expiration Date            Tue, 29 Oct 2024 10:39:59 GMT-0400
Updated                    11 months ago
                           
Provisioning Profile       
                           None assigned yet
                           
✔ What do you want to do? › All: Set up all the required credentials to build your project

✔ Bundle identifier registered com.company.mobile
✔ Synced capabilities: Enabled: Sign In with Apple
✔ Synced capability identifiers: Linked: merchant.com.company, merchant.com.ca.company, merchant.com.company.ca, merchant.com.company.us
✔ Fetched Apple distribution certificates
Provisioning profile is not associated with uploaded Distribution Certificate.
✖ Failed to fetch Apple provisioning profiles
Failed to set up credentials.
Error: Cookie not in this host's domain. Cookie:developer-mdn.apple.com Request:developer.apple.com
Cookie not in this host's domain. Cookie:developer-mdn.apple.com Request:developer.apple.com
Error: Cookie not in this host's domain. Cookie:developer-mdn.apple.com Request:developer.apple.com
    at M.setCookie (/Users/uname/.config/yarn/global/node_modules/@expo/apple-utils/build/index.js:1:705436)
    at M.setCookie (/Users/uname/.config/yarn/global/node_modules/@expo/apple-utils/build/index.js:1:714227)
    at /Users/uname/.config/yarn/global/node_modules/@expo/apple-utils/build/index.js:1:65949
    at new Promise (<anonymous>)
    at /Users/uname/.config/yarn/global/node_modules/@expo/apple-utils/build/index.js:1:65754
    at Object.apply (/Users/uname/.config/yarn/global/node_modules/@expo/apple-utils/build/index.js:1:66685)
    at /Users/uname/.config/yarn/global/node_modules/@expo/apple-utils/build/index.js:1:64766
    at Array.forEach (<anonymous>)
    at c (/Users/uname/.config/yarn/global/node_modules/@expo/apple-utils/build/index.js:1:64738)
    at /Users/uname/.config/yarn/global/node_modules/@expo/apple-utils/build/index.js:1:63081
% eas -v
eas-cli/15.0.10 darwin-arm64 node-v20.11.0

@nmurashi
Copy link

nmurashi commented Feb 26, 2025

Having the same problem here, tried the same solutions to no avail. At one point I got an error stating too many verification codes had been sent, yet I never got one! Quite strange.

EDIT:
The one thing I haven't tried is using device verification instead of SMS verification. But the problem is I never seem to get prompted on what verification method I would like to use, it just defaults to SMS straight away. Even when I delete ~/.app-store and the developer info from the keychain. Note: the device I'm using is a trusted device for the developer account.

@Kungpowpow
Copy link

+1. Pinned fixed doesn't work for me.

@burakgokcinarr
Copy link
Author

As far as I can see the situation is still the same. Yes the parameter “EAS_NO_INTERACTIVE=1 ” works for me but I don't want to use it. I keep checking the eas-cli version and there is no change. I don't know if Expo has an explanation but it is very interesting that it is not solved. Doesn't everyone have this problem ? If the answer is yes, it's even more interesting :)

@nmurashi
Copy link

nmurashi commented Feb 27, 2025

I finally got it to work!

I followed this solution to get the option to select either device or sms.

In case the post ever gets removed and people look this up in the far future, the post reads as:

Version was:
eas-cli/15.0.12 darwin-arm64 node-v20.11.1

I work on my Macbook Pro while signed into my personal Apple account.

  1. I switched my Apple Music account from personal to Apple Developer account.
  2. Ran a build.
  3. Triggered the sign-in to Apple Developer as usual.
  4. This time it prompted me for 2FA, either device or sms.
  5. I chose device and received a 2FA prompt on the Macbook, stayed signed in.
  6. Entered verification code and it totally worked.

Bizarre fix, but I suppose it works. 🤷‍♂️

Note: The Mac I did this on is signed into my personal account, it was only in Apple Music where I changed the account to the developer account. Additionally, the Macbook was setup as a trusted device for the developer account on the Apple Account website. I previously had also deleted ~/.app-store

@bajormar
Copy link

Solution with apple music does not work. Still receiving same old cookie domain mismatch error

@lorddegenx
Copy link

expo team please fix this is really annoying, its been going on for months now @EvanBacon

no solution/workaround is working for me. I was able to build perfectly fine up until 2 weeks ago

@burakgokcinarr
Copy link
Author

Hello everyone :)

I wanted to refocus and take a look. I keep getting the error “Authentication with Apple Developer Portal failed!” in the build process for iOS. As I mentioned in previous posts, I don't want to use any parameters. This is the summary of my situation :)

Now I did something like this.

1-) I upgraded eas cli to the latest version. ( eas -v => eas-cli/15.0.13 darwin-x64 node-v20.17.0 )

2-) I ran rm -rf ~/.app-store/.

3-) Interestingly, I tried the following scenario. Previously, I added scripts like the following to my package.json file for brevity.

“product-ios-build": “eas build --profile production --platform ios”,
“product-ios-dev-build": “eas build --profile development --platform ios”,
“product-android-build": “eas build --profile production --platform android”,
“product-android-dev-build": “eas build --profile development --platform android”

Of course, like before, what I tried was the “npm run product-ios-build” command. The result was : Authentication with Apple Developer Portal failed! :(

But I did point 2 again and this time I ran the “eas build” command directly.
This command asked me for my platform choice (All, iOS and Android), I went with the iOS option and by default it started generating output from the “production” configuration in my eas.json file.

Very interesting ????

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants