Bitly oAuth "Resource Owner Credentials Grants" returning INVALID_LOGIN

174 views Asked by At

I am writing PHP API for Bit.ly using oauth2 for authentication. Their docs say that in order to retrieve access token with username and password we have 2 ways of achieving that:

I was successful only with the basic authentication method, the first method does not work for some reason.

What I did was using PHP cURL methods I appended to header authorization method which was following the docs:

Authorization: "Basic " + base64encode(client_id + ":" + client_secret)

And I also changed content type to:

Content-Type: application/x-www-form-urlencoded

After that I added parameters:

grant_type=password&username=bitlyuser&password=bitlypassword

And I am submiting the post request and I get:

INVALID_LOGIN
1

There are 1 answers

0
James Socol On

That error means the Bitly user name is incorrect. If you are positive it's correct, can you email me at [email protected] with the client ID and the user name?

Sometimes the actual user name may differ from what's displayed, if you signed up via Facebook or Twitter. You can find the actual login by going to your settings and clicking "Show Legacy API Key". (I'll file an issue to move that data outside the API key location.)