Heroku CLI Login - Error Code: mfa_required

Viewed 559

I’ve been trying to login to HEROKU CLI on a headless Ubuntu. So, I don’t have a chance to open a browser. That’s why, I need to login with credential or any other method but there are only two login options which are browser, credentials.

Is there anybody face with the same problem?

Command:

heroku login -i

Error Message:

›   Error: Your account has MFA enabled; API requests using basic authentication with email and password are not supported. Please generate an authorization token 

›   for API access.

›

›   Error ID: mfa_required

PS: The Heroku doesn’t allow me to disable MFA.

2 Answers

Shanshan Chen is basically right, but given the specifics of your issue you're still going to need the -i flag. I have had the same issue and was able to log in successfully using these steps:

  1. Run heroku login -i
  2. Enter your email address as normally
  3. For the password, use your Heroku account API Key (see below)

enter image description here

Related