Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Basic HTTP authentication with the Heroku Platform API

The documentation for the Heroku platform API states that it can be accessed with basic HTTP authentication using the API token, as follows:

HTTP basic authentication must be constructed from email address and api token as {email-address}:{token}, base64 encoded and passed as the Authorization header for each request, for example Authorization: Basic 0123456789ABCDEF=.

We have tried this but keep on getting an "Invalid credentials provided" error.

However, if we substitute our Heroku account password for the token, authentication works:

e.g. {email-address}:{password}, base64 encoded.

However, we don't want to have to use our password for API authentication. How do we get this working using the API token as described?

like image 340
Yarin Avatar asked Sep 03 '25 15:09

Yarin


1 Answers

Look again at the same documentation you linked to (it has changed in the meantime).

You should use Authorization: Bearer HEROKU_TOKEN, not Authorization: Basic HEROKU_TOKEN as you are doing.

like image 71
fiatjaf Avatar answered Sep 05 '25 15:09

fiatjaf