无法从命令行登录 Heroku 帐户

Not able login to Heroku account from command line

我正在使用 codio.com。从那里我使用 ubuntu 终端登录 Heroku,但它给了我以下错误。我也阅读了帮助 page。它说 MFA you have to use browser for login 。但问题是浏览器没有从 Codio 平台打开。我被困在这一点上。请帮忙。

codio@actor-spoon:~/workspace/helloSaas$ heroku login -i                 
heroku: Enter your login credentials
Email: prashantexploring@gmail.com
Password: ********
 ›   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: vaas_enrolled

工作 :):只需粘贴 API 密钥代替密码。

codio@magic-savage:~/workspace/rottenpotatoes$ heroku login -i
 ›   Warning: heroku update available from 7.45.0 to 7.59.2.
heroku: Enter your login credentials
Email: prashantexploring@gmail.com
Password: ************************************
Logged in as prashantexploring@gmail.com
codio@magic-savage:~/workspace/rottenpotatoes$ 

您可以使用“API密钥”作为密码。

在您的 heroku 帐户设置中禁用双因素身份验证。

You can disable two-factor authentication from the Dashboard account page. You will be asked to supply your password for added security. You can also disable it from the CLI with the following command:

$ heroku 2fa:Disable

This will also ask for your password.

(来自 here。)

无法禁用 MFA UI_PIC

到这里浏览帐户设置 向下滚动并显示/重新生成 API-KEY API_KEY

然后通过

登录cli
heroku login -i

输入您的电子邮件并使用 API 密钥作为密码,您可以开始了