简体   繁体   中英

Error in OAuthException in Instagram API

{"code": 400, "error_type": "OAuthException", "error_message": "Redirect URI does not match registered redirect URI"}

I already have client id and secret id . My redirect url is http://localhost . And I also obtained curlhttpclient.php, instagram.php, and example.php from macuenca in github. I modified the example.php and replaced client id, secret, id, and redirect url with mine. But everytime i run the example.php, i get this error.

When you register with Instragram to get your OAuth client_id and client_secret OAuth, you register the URL you intend to redirect to after authentication. That is not matching the URL you are using (localhost).

Likely either you need to

(a) Update your instagram registration, or (b) You are using someone elses secret token, so register your own

More information: https://instagram.com/developer/authentication/?hl=en https://instagram.com/developer/register/

Your redirect URL must be absolute URL ie something like

http://localhost/callback.php

and then make an authentication call from this page itself ie callback.php , otherwise it will not let you to fetch access token, as well pass the complete URL in redirect_url filed

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM