简体   繁体   English

无法运行python-social-auth示例django app

[英]can't run the python-social-auth example django app

Apologies for the basic question. 对基本问题道歉。 I am a user of django-social-auth but can't get python-social-auth off the ground. 我是django-social-auth的用户,但不能让python-social-auth开始。

I have downloaded the example app, successfully sync'ed the db, and added my working facebook, linkedin and twitter app keys to settings. 我已经下载了示例应用程序,成功同步了数据库,并将我工作的facebook,linkedin和twitter app键添加到设置中。 When I run the app I get the sample homepage with all the social media links. 当我运行应用程序时,我会获得包含所有社交媒体链接的示例主页。

When click facebook OAuth2 I get an http error: 400 Client Error: Bad Request. 单击Facebook OAuth2时出现http错误:400客户端错误:错误请求。 Implying that url callback into my server to (/complete/facebook/) is badly formed. 暗示将url回调到我的服务器(/ complete / facebook /)的过程非常糟糕。

When I click LinkedIn or Twitter I get http error: 401 Client Error: Unauthorized. 当我点击LinkedIn或Twitter时,我收到http错误:401客户端错误:未经授权。

Have I missed a bit of the config? 我错过了一些配置吗? Has anyone got the example app working out of the box? 有没有人得到开箱即用的示例应用程序?

Thanks - Guy. 谢了,兄弟们。

Did you set your secret and key for LinkedIn and Twitter in your settings.py? 你在settings.py中为LinkedIn和Twitter设置了秘密和密钥吗?

Once that is done you may have to set the redirect urls with those providers. 完成后,您可能必须使用这些提供程序设置重定向URL。

I tested with google and had to fix my Google API Access settings. 我使用谷歌测试并且必须修复我的Google API访问设置。

I changed redirect urls to http://localhost:8000/complete/google-oauth2/ 我将重定向网址更改为http://localhost:8000/complete/google-oauth2/

UPDATE: I am having issues with LinkedIn on oauth1 & 2. There doesnt appear to be a way to get the required API key into the request. 更新:我在oauth1和2上遇到LinkedIn问题。似乎没有办法在请求中获取所需的API密钥。 I have attempted to hard code in the oauth1_auth.py of requests_oauthlib but with no success yet. 我试图在requests_oauthlib的oauth1_auth.py中硬编码,但还没有成功。

UPDATE 2: Twitter worked for me by making sure my twitter developer application settings had "Allow this application to Sign in with Twitter" checked and my consumer key and secret set in my settings.py like so: 更新2:Twitter通过确保我的Twitter开发人员应用程序设置“允许此应用程序使用Twitter登录”选中,并且我的settings.py设置了我的消费者密钥和密码,为我工作:

# TWITTER
#
SOCIAL_AUTH_TWITTER_KEY = '<...>'
SOCIAL_AUTH_TWITTER_SECRET = '<.....>'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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