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

查看:46
本文介绍了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天全站免登陆