- Published on
Get local Instagram api credentials with ngrok
- Authors
- Name
- Christophe Jossart
- @colorfield
It can be long to find the way through the documentation for these simple steps, so here is a shortcut.
Go to https://www.instagram.com/developer/clients/manage/ and get a Client ID and Client Secret.
- Start a local server
php -S localhost:8000
- Start Ngrok and get the forwarding url
(e.g. http://my.ngrok.io)
./ngrok http 8000
Copy this url into the security tab from the Instagram ui
Get the code
Access this url from the browser:
https://www.instagram.com/oauth/authorize/?client\_id=CLIENT-ID&redirect\_uri=http://my.ngrok.io&response\_type=code
it will redirect then to http://my.ngrok.io/?code=CODEGet the access token
curl -F 'client_id=CLIENT-ID' \
-F 'client_secret=CLIENT-SECRET' \
-F 'grant_type=authorization_code' \
-F 'redirect_uri=http://my.ngrok.io' \
-F 'code=CODE' \
https://api.instagram.com/oauth/access_token