fastlane: Enterprise Account - produce login failed return Your session has expired. Please log in.

New Issue Checklist

Issue Description

Everything work great till Today i have problem with same Enterprise Account, when use produce to create app in develope portal , it throw error. I had researched a lot and see some people report this but nothing work with me. (4981 188 3106 Please help me solve this!.

Complete output when running fastlane, including the stack trace and command used
[11:26:22]: -------------------------------------------------
[11:26:22]: --- Step: Verifying required fastlane version ---
[11:26:22]: -------------------------------------------------
[11:26:22]: fastlane version valid
[11:26:22]: ------------------------------
[11:26:22]: --- Step: default_platform ---
[11:26:22]: ------------------------------
[11:26:22]: Driving the lane 'ios enterprise' 🚀
[11:26:22]: ---------------------
[11:26:22]: --- Step: produce ---
[11:26:22]: ---------------------

+----------------+------------------------+
|        Summary for produce 1.1.2        |
+----------------+------------------------+
| username       | xxxxx@xxx.vn    |
| app_identifier | vn.xxx.n1196.enter |
| language       | xxxx             |
| app_name       | H3Q Miki               |
| company_name   | H3Q Miki               |
| app_version    | 1.23                   |
| skip_itc       | true                   |
| sku            | 1468470382             |
| skip_devcenter | false                  |
| team_id        | 9Y437UYEPP             |
+----------------+------------------------+

[11:26:30]: Variable Dump:
[11:26:30]: {:DEFAULT_PLATFORM=>:ios, :PLATFORM_NAME=>:ios, :LANE_NAME=>"ios enterprise"}
[11:26:30]: {"responseId"=>"61ca829a-9340-466d-976f-b4d79eab112f", "resultCode"=>1100, "resultString"=>"authentication.failed", "userString"=>"Your session has expired.  Please log in.", "creationTimestamp"=>"2016-07-14T04:26:30Z", "protocolVersion"=>"QH65B2", "userLocale"=>"en_US", "requestUrl"=>"https://developerservices2.apple.com/services/QH65B2/listTeams.action", "httpCode"=>200}

+------+-------------------------------------+-------------+
|                     fastlane summary                     |
+------+-------------------------------------+-------------+
| Step | Action                              | Time (in s) |
+------+-------------------------------------+-------------+
| 1    | Verifying required fastlane version | 0           |
| 2    | default_platform                    | 0           |
| 3    | produce                             | 7           |
+------+-------------------------------------+-------------+

[11:26:30]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

➡️  Sigh: authentication.failed Your session has expired.  Please log in.
   https://github.com/fastlane/fastlane/issues/4981 [closed] 3 💬
   6 weeks ago

➡️  sigh: authentication.failed / Your session has expired.  Please log in.
   https://github.com/fastlane/fastlane/issues/4157 [closed] 16 💬
   2 weeks ago

➡️  [!] Apple provided the following error info: authentication.failed Your session has expired. Please log in.
   https://github.com/fastlane/fastlane/issues/4337 [closed] 2 💬
   25 Apr 2016

and 9 more at: https://github.com/fastlane/fastlane/search?q=Apple provided the following error info:
    authentication.failed
    Your session has expired.  Please log in.&type=Issues&utf8=✓

[!] Apple provided the following error info:
    authentication.failed
    Your session has expired.  Please log in.

Configuration Files

Please copy the complete content of your Fastfile and any other configuration files you use below:

Fastfile:

 lane :enterprise do
    # match(type: "appstore")
    # snapshot
    ENV["FASTLANE_XCODE_LIST_TIMEOUT"] = "0"

    produce(
        username: 'xxx@xxx.vn',
        app_identifier: 'vn.xxx.n1196.enter',
        language: 'Vietnamese',
        app_name: 'H3Q Miki',
        company_name: 'H3Q Miki',
        app_version: '1.23',
        skip_itc: true
      )
    update_project_team(
    path: "platforms/ios/H3Q Miki.xcodeproj",
    teamid: "9Y437UYEPP"
    )
    sh "produce enable_services --push-notification"
    sh "pem -a  vn.xxx.n1196.enter -u xxx@xxx.vn -e /Users/macpro/Documents/Developer/xxx/1196/certificates"
    cert
    sigh(force: false,output_path:'/Users/macpro/Documents/Developer/xxx/1196/certificates')
    update_project_provisioning(
      xcodeproj: "platforms/ios/H3Q Miki.xcodeproj",
    )
    gym(scheme: 'H3Q Miki', project: "platforms/ios/H3Q Miki.xcodeproj",
      output_directory: "/Users/macpro/Documents/Developer/xxx/1196/Build/Enterprise",
      export_method: "enterprise",
      use_legacy_build_api: true,
      include_bitcode: false,
      clean: true
      )

    # frameit
  end

Environment

fastlane version (run fastlane -v): fastlane 1.97.2

Do you use bundler to execute fastlane (i.e. bundle exec fastlane)? no

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? i use default macbook

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 7
  • Comments: 33 (4 by maintainers)

Most upvoted comments

I wouldn’t class this as a proper fix though? Is there not a better workaround?

Getting same error as mentioned, Authentication failed.

Note: This error on produce is for enterprise accounts only, it works fine for normal developer accounts.

Adding the user to iTC worked. I added the user with a sales role in iTC, not necessarily an admin.

I solved the problem with an account that only has developer accounts here: https://github.com/fastlane/fastlane/issues/5386#issuecomment-232766082 (not sure if it also applies to enterprise accounts).

It seems that adding the Apple ID account to iTunes Connect fixes the problem.

Thanks your All, i Confirm that add Enterprise account to ITC will resolve this bug, for easy for other people to resolve this, here step to step:

  1. Login to Itune Connect by Appstore account
  2. Navigate to “User and Role”
  3. Click button (+) right of Users label
  4. Fill your email of Enterprise account and hit Next --> choose Role Admin ( i haven’t try another role yet) --> Done
  5. Log out this Acount
  6. Login ITC by Enterprise Account
  7. a Dialog show, just hit Accept –> From now try rebuild by Fastlane, everything work perfect again!.

The workarounds above do work. We changed it ot use an account that has access to many developer / iTC teams and explicitly pass the team_id to produce.

Weird this is happening even when skip_itc is true.

As mentioned previously, my Apple ID has 2 Apple Developer programs (App Store and Enterprise). It really does seem like you will need the Apple ID to have access to the iTunes connect. (I am not sure if this is because of the Apple ID is associated with an App Store account, and if I had separate Apple IDs that the enterprise account would be unaffected).

Anyway, I managed to fix this by first getting invited to the iTunes connect for the App Store account and accepting to the Terms of Service dialog. And after that, fastlane init works fine.

This sounds like a workaround for now. I hope this helps anyone who is investigating into the matter.

+1. We do not use iTC with out enterprise account, so it seems the workaround a few people have gotten to work, won’t work for us.

@TechGuyVN: Might be the wrong issue, as I am having problems with “match” and not “produce”. But it seems like the sigh step is failing in exactly the same way for you as for me.

I too am using an Enterprise account. In your developer portal you have a choice called “iTunes connect” which is where you apply for an app review when going to AppStore. Even though a user has access to the developer portal, access to iTunes connect is not given implicitely. So I added the user in question as an admin in iTunes Connect. And boom, stuff started working again. Hope this helps you 😃

Getting the exact same error, we have enterprise account aswell. Even tried setting up a completely new user in the development program, got the same error. The exact same version of gems were running yesterday without problems as the ones used today.

Agreed, this was working the day before yesterday, isn’t now

{"responseId"=>"ad491748-2152-424a-99f0-6aaa516b72fe", "resultCode"=>1100, "resultString"=>"authentication.failed", "userString"=>"Your session has expired. Please log in.", "creationTimestamp"=>"2016-07-14T06:12:50Z", "protocolVersion"=>"QH65B2", "userLocale"=>"en_US", "requestUrl"=>"https://developerservices2.apple.com/services/QH65B2/listTeams.action", "httpCode"=>200}

AppFile only contains the bundle identifier and apple id

app_identifier "xxx" # The bundle identifier of your app
apple_id "xxx" # Your Apple email address

(masked obviously)

Gymfile

scheme "xxx"
output_directory "./fastlane/builds"
configuration "Debug"

Fastfile

...
cert
sigh
gym

Building with Xcode 8 (with project configured for “manual” signing mode and “automatic” signing mode … test separately obviously)

Haven’t tested my “personal” account, this is against my work account. I can login to the developer profile just fine

It seems like this issue might be related to code signing 🚫

Have you seen our new Code Signing Troubleshooting Guide? It will help you resolve the most common code signing issues 👍