Oauth2 Instagram API“重定向URI与注册的重定向URI不匹配". [英] Oauth2 Instagram API "redirect URI does not match registered redirect URI"

查看:288
本文介绍了Oauth2 Instagram API“重定向URI与注册的重定向URI不匹配".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发中的Rails应用程序上,它可以向omniauth注册.

I am working on a Rails application which is in development mode and it can register with omniauth.

主机是

http://localhost:3000/

我正在使用宝石:

gem 'omniauth'
gem 'omniauth-foursquare'
gem 'omniauth-instagram'

当我通过omniauth向Foursquare注册时,根本没有问题.所有设置都正确,Foursquare开发人员设置中的redirect_uri等于主机(localhost:3000)

When I register through omniauth with Foursquare there's no problem at all. All the settings are right and my redirect_uri in the Foursquare developer settings equals to the host (localhost:3000)

但是,如果我在Instagram客户端管理器*中填写完全相同的redirect_uri(localhost:3000). Instagram给我这个:

However, if I fill in the exact same redirect_uri (localhost:3000) in the Instagram client manager*. Instagram gives me this:

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

基于此URL:

https://instagram.com/oauth/authorize?response_type=code&client_id=<ID>&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Finstagram%2Fcallback&state=18415adf24dd97873e61094f67c0fb7a94857fedf93e9d2e&scope=basic

*

根据Instagram,我在做什么错?应该如何解决?

What am I doing wrong according to Instagram and how should this be fixed?

推荐答案

本人已解决此问题.添加了localhost:3000/auth/instagram/callback作为redirect_uri,效果很好.

Fixed the issue myself. Added localhost:3000/auth/instagram/callback as redirect_uri and it worked just fine.

这篇关于Oauth2 Instagram API“重定向URI与注册的重定向URI不匹配".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆