Heroku Invalid credentials provided

In Your First Rails Application, at Step 4.3: Adding your SSH key to Heroku:

$ heroku keys:add
Uploading /home/mike/.ssh/id_rsa_hotmail.pub SSH key… !
▸ Invalid credentials provided.

Check that heroku email matches git user.email,

the heroku email is copy/paste from the heroku account page

$ git config user.email | md5sum
f0c02cd14883f5f708722af1d8cfece0 -
$ echo | md5sum
f0c02cd14883f5f708722af1d8cfece0 -

Does anybody have any ideas?

What is your git config user.email. When you got to heroku.com is it the same email as in your profile? No extra dots?

1 Like

The email was elided.
The md5 sum is the same for both git and the Heroku account, so no extra characters of any kind.

I had this same issue. I was able to fix it by logging into the heroku CLI first but running the command heroku login in the terminal.


Can verify this as of about 5 minutes ago. Simply did the following to be precise:

  1. ran:

heroku login

this actually was able to pull up my browser as intended, original heroku keys:add would try to when it was failing and fail to pull up the browser as well for some reason.

  1. then I would login to heroku using respective login information and wait for it to confirm I was logged in.

  2. run:

heroku keys:add

and this would be successful this time around

hope this helps

ANOTHER NOTE: It’s important to note here that it seems to be that you need to be in the my_first_apps or whatever you named and made the original directory in. I believe the problem some people might be having is that they might be putting this lesson down in the middle of it and booting their VM up the next day to start without realizing that everything from the heroku section needs to be in the directories specified previously and also after “git init” has been executed.

Someone who is much more experienced than me please feel free to come along and add to this / correct me as I’ve only made it this far in the course and am pretty ignorant to the specifics.


I fixed my issue by following your instructions also. Not sure why this was necessary though. Thanks!

Absolutely apt answer.
Thanks a lot.