socialauth

记录下自己亲自做的Django项目继承QQ第三方登录

主宰稳场 提交于 2020-04-10 17:58:45
Django2.0 先申请QQ互联地址 ->注册认证开发者->创建应用等待审核 下面用social_django第三方库来实现第三方登录 github地址,上面有使用说明 http s: //github. com/ python-social-auth/social-app-django (1) 安装 pip install social-auth-app-django (2)INSTALL_APP中配置 'social_django', (3)生成表 只需要做migrate,因为migration的文件已经生成好了,数据库中多了五张表,存储第三方登录的信息。 python manage .py migrate (4) 添加到 AUTHENTICATION_BACKENDS 中 # settings.py AUTHENTICATION_BACKENDS = ( 'social_core.backends.weibo.WeiboOAuth2', 'social_core.backends.qq.QQOAuth2', 'social_core.backends.weixin.WeixinOAuth2', 'django.contrib.auth.backends.ModelBackend', ) (5)配置url # 第三方登录 url( '', include( 'social

Django中使用第三方登录

拟墨画扇 提交于 2020-04-06 13:08:25
OAuth2.0是什么 OAuth的英文全称是Open Authorization,它是一种开放授权协议。OAuth目前共有2个版本,2007年12月的1.0版(之后有一个修正版1.0a)和2010年4月的2.0版,1.0版本存在严重安全漏洞,而2.0版解决了该问题。 OAuth简单说就是一种授权的协议,只要授权方和被授权方遵守这个协议去写代码提供服务,那双方就是实现了OAuth模式。 OAuth2.0实现第三方登录的流程 例如你想登录豆瓣去看看电影评论,但你丫的从来没注册过豆瓣账号,又不想新注册一个再使用豆瓣,怎么办呢?不用担心,豆瓣已经为你这种懒人做了准备,用你的qq号可以授权给豆瓣进行登录。流程如下: 第一步:在豆瓣官网点击用qq登录 当你点击用qq登录的小图标时,实际上是向豆瓣的服务器发起了一个 http://www.douban.com/leadToAuthorize 的请求,豆瓣服务器会响应一个重定向地址,指向qq授权登录。 浏览器接到重定向地址 http://www.qq.com/authorize?callback=www.douban.com/callback ,再次访问。并注意到这次访问带了一个参数是callback,以便qq那边授权成功再次让浏览器发起这个callback请求。不然qq怎么知道你让我授权后要返回那个页面啊,每天让我授权的像豆瓣这样的网站这么多。

SocialAuth-Android Couldn't find the URL

你。 提交于 2020-01-05 23:50:32
问题 I use library socialauth to authorize login to social network. A few day it work normally after i replace file jar from socialauth-android-2.0.jar to socialauth-android-2.1.jar but now i test again it not work and show error: org.brickred.socialauth.android.SocialAuthError: Couldn't find the URL. Could you tell me some solution please? Have other Java library that can use to auth to social network and get profile information like this lib? (only Facebook and Twitter is enough) 回答1: Now i can

getting list of friends from facebook

瘦欲@ 提交于 2019-12-24 12:00:32
问题 Facebook API does not provide friends list of people using our fb app, according to their developer faq page. But still, websites like nimble and the live example of socialauth are able to get the names of people on our friend list, even those who do not use their app. Please, can any one help me with how this work? The read_friendlist permission gives only name of lists like 'close friends', 'aquaintance' etc. the user_friends permission gives only the list of people in our friendlist who

how do i connect multiple social auth providers to the same django user using django-allauth?

好久不见. 提交于 2019-12-21 02:22:10
问题 can connect to facebook and twitter, but how do i connect a normal django user to both his facebook and twitter networks, so that the next time he has the option of logging in through any 1 of the 3 and i can utilise information from both the networks. can the signal :- allauth.socialaccount.signals.pre_social_login be used to check if a user is already logged in if yes connect the social account to the django account, but i cant figure out how to go about implementing this in the login view.

How use SocialAuth with JSF to redirect?

痞子三分冷 提交于 2019-12-19 10:18:24
问题 I'm trying to use SocialAuth, the idea is very simple, click in log in with facebook then redirect the user to my website signed in. The log in part I get it, which is below : 1) /index.xhtml <h:form id="login-facebook"> <h:commandButton id="login" action="#{socialFacebook.login}" value="Login"/> </h:form> 2) socialFacebook bean package controller; @ManagedBean(name="socialFacebook") @RequestScoped public class SocialFacebook implements Serializable{ private static final long serialVersionUID

How to add multiple redirect URIs for Google OAuth 2?

拥有回忆 提交于 2019-12-18 11:45:09
问题 I am trying to make Google OAuth 2 authentication work with a toy app I am running on my computer (at localhost:8080 ) using Social Auth for Java. However when my app connects to Google to authenticate the user, Google responds with this error page: My app, named "My Hobby App", is configured in the Developer Console as such: In the Google OAuth 2 docs, it is specified that: redirect_uri: One of the redirect_uri values listed for this project in the Developers Console. Determines where the

SocialAuthManager object ('manager') becomes NULL after redirection in case of SocialAuth libraries with JSF application?

邮差的信 提交于 2019-12-13 04:51:19
问题 I am using SocialAuth libraries in my JSF application for providing 'login with google/facebook'. As shown below it requires me to stores the SocialAuthManager object ('manager') in the session and then redirect to 'google/facebook' URL //Create an instance of SocialAuthManager and set config SocialAuthManager manager = new SocialAuthManager(); manager.setSocialAuthConfig(config); // URL of YOUR application which will be called after authentication String successUrl= "http://opensource

socialauth-android authorization successfull with Facebook but verification code is null

删除回忆录丶 提交于 2019-12-12 14:07:57
问题 I'm using socialauth-android to let my Android users authenticate themselves on Facebook. My issue as follows: I can successfully display the Facebook log in page where the user can enter the credentials and authorize my app. When the authorization is complete, the callback method onComplete of the ReponseListener linked to SocialAuthAdapter should be invoked. This never happens as I got an exception saying that the verification code is null but I can see on the facebook user page that my app

JSF Login with Facebook (SocialAuth) and keeping Session alive

牧云@^-^@ 提交于 2019-12-11 18:39:37
问题 I've been stuck on this issue for quite a while, and I've re-formulated my question a few times. I'll be explicit with this one, providing the implementation below: index.xhtml , the short version. ... <f:event listener="#{userBacking.pullUserInfo}" type="preRenderView" /> <h:commandLink action="#{userBacking.login()}" value="Login" rendered="#{!userBacking.isLoggedIn()}"/> <h:commandLink action="#{userBacking.logout()}" value="Logout" rendered="#{userBacking.isLoggedIn()}" /> <h:outputText