oauth - Instagram: Redirect URI does not match registered redirect URI -


error

{"code": 400, "error_type": "oauthexception", "error_message": "redirect uri not match registered redirect uri"} 

appeared on

https://instagram.com/oauth/authorize?response_type=code&client_id=2fa4359e4340434786e469ab54b9b8c0&redirect_uri=http://localhost:8000&scope=likes 

instagram settings

client id   2fa4359e4340434786e469ab54b9b8c0 website url http://localhost:8000/ 

code

$authprovider.oauth2({   name: 'instagram',   url: 'http://localhost:3000/auth/instagram',   redirecturi: 'http://localhost:8000',   clientid: '2fa4359e4340434786e469ab54b9b8c0',   requiredurlparams: ['scope'],   scope: ['likes'],   scopedelimiter: '+',   authorizationendpoint: 'https://api.instagram.com/oauth/authorize' }); 

any appreciated. thanks!

you need url encode value of redirect_uri parameter http%3a%2f%2flocalhost%3a8000 prevent scope parameter becomes part of redirect_uri value instead of authorization request.

you'll have make sure redirect_uri matches exactly, including last slash you've registered with.

so authorization request becomes:

https://instagram.com/oauth/authorize?response_type=code&client_id=2fa4359e4340434786e469ab54b9b8c0&redirect_uri=http%3a%2f%2flocalhost%3a8000%2f&scope=likes 

Comments