philsturgeon / codeigniter-oauth2

NO LONGER ACTIVELY MAINTAINED. USE https://github.com/thephpleague/oauth2-client INSTEAD
http://getsparks.org/packages/oauth2/versions/HEAD/show
349 stars 177 forks source link

Access token request returns 400 error using Instagram provider #15

Open jahvi opened 12 years ago

jahvi commented 12 years ago

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!

philsturgeon commented 12 years ago

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

pangguoming commented 9 years ago

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