问题标签 [python-social-auth]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - Python Social Auth:如何定义不同的用户名方案?
Python Social Auth 中的默认用户名生成方案是采用经过身份验证的社交网络的用户名,如果已经采用,则为其添加一些随机值(或者它是一个哈希?)。
无论如何,我想改变这种行为,我想定义我自己的用户名生成方法。例如用户名+提供者+随机。
想法?
python - python-social-auth 和 github,我有这个错误“redirect_uri 必须匹配此应用程序的注册回调 URL”
我在一个项目中使用 python-social-auth 来通过 Github 对用户进行身份验证。我需要根据用户使用的链接重定向用户。为此,我在 url 上使用了 next 属性,并且在我的 django 设置中也没有在我的 github 应用程序上声明任何重定向 url。
这是我用于链接的 href 属性:{% url 'social:begin' 'github' %}?next={% url 'apply' j.slug %}
第一次点击它时,我被重定向到我的主页,并在 url 字段中出现此错误:http://127.0.0.1:8000/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fv3%2Foauth%2F%23redirect-uri-mismatch&state=Ui1EOKTHDhOkNJESI5RTjOCDEIdfFunt
但是在第一次链接工作之后。
我不知道问题出在哪里,希望有人能帮助我。谢谢
python - Users are not created after login with facebook (probably an homonymy case)
I am trying to learn how to integrate python social auth into a django project.
It seems to work, because I can log into my test application, but it seams that the user is never stored to the db and I can't understand why, since I don't get any error.
Here's my conf
My idea is just to use django default model for the user, so I haven't defined any extension for it.
Do you have any idea why users are not created at login?
UPDATE
I noticed something that looks weird, at least to me. The first admin user which is created when doing syncdb has the same first and last name of the facebook account I am using to test the application. I thought that it was not going to be used and that another user had to be created, but while checking the database i saw that auth_user.last_login
was updated accordingly to the login performed with facebook.
So I have these two questions:
- is it correct that python social auth checks if a user with the same first and last name is already present in auth_user then it uses that particular user instead of creating another one?
- how can I avoid the situation where user Foo Bar on facebook and user Foo Bar on Twitter are not the same person?
python - 将通过 Python Social Auth 登录的用户添加到组
当用户通过 Python Social Auth 注册时,他们会在我的数据库中创建为用户,这很好,但我希望在创建用户时将它们添加到某个组中。
怎么做?
django - python-social-auth 与 django。无法在 VK.com 中获取用户电子邮件
settings.py
有:
但它不起作用。同时我可以收到来自 Facebook 的电子邮件。
django - 在 PythonSocialAuth 中登录与注册
我正在使用PythonSocialAuth (v0.1.23),我需要将“注册”(创建新用户帐户)与登录区分开来。在PSA Django 示例中,如果新用户尝试登录,管道逻辑会将新用户重定向到“注册表单”;我想避免这种“登录或注册”行为。
我需要的是:
- 如果新用户尝试登录,则会引发错误。
- 强制新用户注册以创建新帐户/个人资料。
知道如何操纵 PSA 管道以实现此目的吗?(我使用的是 Django 1.6)。
提前致谢。
twitter - 使用 twitter sweetpie python social auth 进行身份验证返回 403
我正在使用 sweetpie 和 python-social-auth 管理我的社交身份验证。通过执行以下操作,我通过 facebook 进行身份验证没有问题:
但是当我尝试对 provider="twitter" 和有效的访问令牌做同样的事情时,我在调用 'do_auth' 方法时不断收到 403。我设法卷曲到 twitter api,所以我的凭据是有效的。
我错过了任何步骤吗?twitter 的身份验证应该与 facebook 的不同吗?
谢谢!
django - 如何在自定义用户模型中保存用户信息?
我正在使用 python-social-auth 将用户登录到我的网站,效果很好,但我想使用自定义用户模型,它不仅可以保存有关用户的基本信息,还可以获取他们的个人资料图片。
这是我的用户模型
这是管道功能
这是获取用户个人资料图像的另一个功能
我只是先在 facebook 上尝试,但我似乎无法在数据库中填充名称字段,而且我还必须登录两次才能将其保存到默认的 social-auth 表中。这两个函数都已添加到 settings.py 文件中,我还想知道它们在提示中的位置是否重要,因为它们位于底部,即身份验证过程的最后一部分?
python - 使用 Python Social Auth 过滤或限制 Google-Oauth2 登录到 Django 中的一组用户
我已经能够通过域将它们过滤掉,但是如果我想使用一些正则表达式进行进一步过滤。我可以这样做吗?我最近一直在研究很多;我认为制作部分管道是解决方案。但由于糟糕的文档;我无法实现我的目标。添加中间件也无济于事,因为登录过程完全覆盖了我添加的功能。我想做这样的事情。
中间件.py
问题是它处理每个请求,而不是专门处理登录请求。它也不起作用。请指出我哪里出错了。
帮助表示赞赏!谢谢!
django - Python-social-auth:禁用自动注册新用户
我在将 PSA 设置为不在登录时注册新用户时遇到问题。文档说:
It’s possible to override it by defining the setting SOCIAL_AUTH_PIPELINE, for example a pipeline that won’t create users, just accept already registered ones would look like this:
我将此代码添加到我的设置中,尝试使用已经注册的用户通过 Facebook 登录,然后我被重定向到默认/accounts/login/#_=_
页面。
使用默认管道设置一切正常,我可以登录。