fastlane/boarding

How to deploy to Heroku with 2-factor?

hintoz opened this issue ยท 6 comments

At the moment, is there a way to install a new app with two-factor authentication on Heroku?
All the above methods do not work now.

Are you talking about 2FA on your Apple account connected to AppStore Connect?

@hintoz If you could provide a little more detail on what you are trying to accomplish that would be great! iOS and Android apps (which fastlane supports) are not deloyable on Heroku so we might need some clarification on what you are trying to accomplish ๐Ÿ™ƒ

Sent with GitHawk

Are you talking about 2FA on your Apple account connected to AppStore Connect?

Yes.

@hintoz If you could provide a little more detail on what you are trying to accomplish that would be great! iOS and Android apps (which fastlane supports) are not deloyable on Heroku so we might need some clarification on what you are trying to accomplish ๐Ÿ™ƒ

Sent with GitHawk

Since the question is in the repository boarding, then the question is about it.

I solved the problem of deploying the new boarding on Heroku as follows:
Create an empty application on Heroku.
Then in terminal:
heroku git:clone --app [heroku_app_name] (it will be an empty repo)
cd [heroku_app_name]
Create a Gemfile with the contents:

source 'https://rubygems.org'
gem 'fastlane'

Run bundle install, then git push
Now we have fastlane deployed to heroku and we can receive heroku run fastlane spaceauth authorization sessions. Configure all env on heroku.
Previously, you could just put fastlane on heroku, via heroku run gem install fastlane.

Now we need boarding.
delete gemfile and gemfile.lock (do not forget the committing all of his actions) and execute

git pull https://github.com/fastlane/boarding
git push

Hi, I have made an amendment to this that adds the FASTLANE_SESSION variable to the app.json. This is a preferable solution because it allows users to use the "deploy to heroku" button and have it work out of the box, rather than the solution above. I will submit this as a PR.

I followed @hintoz's steps above and managed to get Boarding deployed to Heroku with a session generated using spaceauth to get around 2FA problems. Here's what I did.

Clone locally.

git clone https://github.com/fastlane/boarding.git

Edit the Gemfile to just include fastlane (comment out or remove the other boarding-specific gems)

# ruby '2.3.3'
gem 'fastlane', '>= 2.126.0', '< 3.0.0'

Commit and push to your Heroku app. (Make sure app should has a blank repo.)

Then run heroku run fastlane spaceauth and sign in to App Store Connect through the terminal, inputting your 2FA code when prompted. This will create a session on the Heroku server. Note - you must do this on the server. In my experience if you run this locally the session cannot be transferred to the server.

Copy the FASTLANE_SESSION from the terminal output into Heroku as a config (env) var. This will allow Heroku to use the App Store connect session for around a month.

Make sure all these vars are set in Heroku:

  • FASTLANE_SESSION
  • ITC_APP_ID
  • ITC_APP_TESTER_GROUPS
  • ITC_PASSWORD
  • ITC_USER

Now edit the Gemfile to mirror that off the original boarding repo (reverting the previous commit is the easier way.) Commit and push back Heroku. Boarding will now deploy and connect to App Store Connect using your session information and username and password.

Hope this helps someone.