codeigniter-oauth2
codeigniter-oauth2 copied to clipboard
Access token request returns 400 error using Instagram provider
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!
Try switchthing the method from GET to POST in the provider and see what happens.
i get the same error, i think you call api too frequently