くらげになりたい。

くらげのようにふわふわ生きたい日曜プログラマなブログ。趣味の備忘録です。

Herokuでpushした際に認証失敗してDeployできなかったときの対処方法(heroku auth:tokenを使う)

久々にWindowsでHerokuにデプロイしようと思ったら上手く行かなかったので、その備忘録。

git push heroku masterをしたら、認証に失敗した

認証に失敗して、以下のメッセージが表示。。
同じID/Passでは、Webのコンソールにはアクセスできるのに。。

remote: !       WARNING:
remote: !       Do not authenticate with username and password using git.
remote: !       Run `heroku login` to update your credentials, then retry the git command.
remote: !       See documentation for details: https://devcenter.heroku.com/articles/git#http-git-authentication
fatal: Authentication failed for 'https://git.heroku.com/xxxxxxxxx.git/'

アクセストークンを利用するとうまくいくよう

以下の記事にある通り、試してみたらうまくいった!!

qiita.com

以下、引用。

heroku auth:token
と入力して、続けて表示された文字列をコピーします。
同じようにgit push heroku masterとした時に、以下のように対応します。

Username for 'https://git.heroku.com': (空エンター)  
Password for 'https://git.heroku.com': コピーした文字列

以上!!

参考にしたサイト様