使用Python Social Auth“重定向URI与注册的重定向URI”不匹配 [英] 'Redirect URI does not match registered redirect URI' using Python Social Auth

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

问题描述

我正在使用 python-social-auth 进行社交网络认证。

I am using python-social-auth for authentication with social networks.

我已经安装并配置了一切。在最后一步,我添加了这两个动作链接:

I have installed and configured everything. In the last step, I added these two action links:

<a href="{% url 'social:begin' 'facebook' %}">Login with Facebook</a>
<a href="{% url 'social:begin' 'instagram' %}">Login with Instagram</a>

Facebook登录状态正常,但instagram给我以下错误:

Facebook login is working fine but instagram is giving me the following error:

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

我有这些:

SOCIAL_AUTH_INSTAGRAM_KEY = 'my_key'
SOCIAL_AUTH_INSTAGRAM_SECRET = 'my_secret'

INSTAGRAM_REDIRECT_URI = 'http://localhost:8000/shops/edit'

最有趣的部分是如果我尝试这样做没有 python-social-aut ,即使用这些配置:

the most interesting part is that if I try to do this without python-social-aut, i.e. using these configurations:

INSTAGRAM_CLIENT_ID = get_env_setting('INSTAGRAM_CLIENT_ID')
INSTAGRAM_CLIENT_SECRET = get_env_setting('INSTAGRAM_CLIENT_SECRET')
INSTAGRAM_REDIRECT_URI = get_env_setting('INSTAGRAM_REDIRECT_URI')

它只是工作正常。

我认为这与python-social-auth应用有关系。

I am thinking it has something to do with that python-social-auth app.

修改它?

推荐答案

尝试设置SOCIAL_AUTH_INSTAGRAM_REDIRECT_URL例如

Try to set SOCIAL_AUTH_INSTAGRAM_REDIRECT_URL for example

SOCIAL_AUTH_INSTAGRAM_REDIRECT_URL = 'http://localhost:8000/complete/instagram'

并检查您的重定向uri您的instagram客户端设置。

and check redirect uri in you instagram client settings.

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

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