codeigniter-oauth2 icon indicating copy to clipboard operation
codeigniter-oauth2 copied to clipboard

Access token request returns 400 error using Instagram provider

Open jahvi opened this issue 13 years ago • 2 comments

I just tried using the Instagram provider to authenticate users in my app and for te most part it works out fine, however when after users grant access to my app and I try to run:

$token = $provider->access($_GET['code']);

I get a 400 Request error, I tried doing the same request via CURL like it says in the Instagram docs:

curl \
    -F 'client_id=CLIENT-ID' \
    -F 'client_secret=CLIENT-SECRET' \
    -F 'grant_type=authorization_code' \
    -F 'redirect_uri=YOUR-REDIRECT-URI' \
    -F 'code=CODE' \
    https://api.instagram.com/oauth/access_token

And it returns the access_token just fine so could it be a problem in how the POST request is beign handled?

Thanks in advance!

jahvi avatar Apr 05 '12 07:04 jahvi

Try switchthing the method from GET to POST in the provider and see what happens.

philsturgeon avatar Apr 29 '12 10:04 philsturgeon

i get the same error, i think you call api too frequently

pangguoming avatar Oct 01 '15 03:10 pangguoming