Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
438 views
in Technique[技术] by (71.8m points)

ios - Fastlane Boarding with two-factor authentication

I followed the "Getting Started" guide on the boarding github page, but I keep getting this error on my heroku page We're sorry, but something went wrong.

The boarding page does say that the two-factor auth works and to go here: https://github.com/fastlane/fastlane/blob/master/spaceship/README.md#2-step-verification but I'm not sure how to add that cookie to my heroku site.

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Fastlane now (as of version 2.160.0) supports Apple's App Store Connect API. This avoids all the problems with 2FA session hacks. There are still a few fastlane actions that do not have full support but the majority do.

https://docs.fastlane.tools/app-store-connect-api/ explains how to start using an API key in fastlane.

In summary, here's what you need to do (these examples come straight from that documentation):

  1. Create an App Store Connect API Key
  2. From that same page, download the new key .p8 private key file and save it somewhere safe (WARNING: you can only download it once). Take note of the Key ID and the Issuer ID as you'll need them again shortly.
  3. Either use the app_store_connect_api_key action to specify the new key in your Fastfile:
lane :release do
  api_key = app_store_connect_api_key(
    key_id: "D383SF739",
    issuer_id: "6053b7fe-68a8-4acb-89be-165aa6465141",
    key_filepath: "./AuthKey_D383SF739.p8",
    duration: 1200, # optional
    in_house: false, # optional but may be required if using match/sigh
  )

  pilot(api_key: api_key)
end

Or, write the details to a JSON file:

{
  "key_id": "D383SF739",
  "issuer_id": "6053b7fe-68a8-4acb-89be-165aa6465141",
  "key": "-----BEGIN PRIVATE KEY-----
MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHknlhdlYdLu
-----END PRIVATE KEY-----",
  "duration": 1200, # optional
  "in_house": false, # optional but may be required if using match/sigh
}

and reference the JSON file either in your Fastfile:

lane :release do
  pilot( api_key_path: "fastlane/D383SF739.json" )
end

Or via the command line:

$ fastlane pilot distribute --api_key_path fastlane/D383SF739.json

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...