Vous êtes sur la page 1sur 2

How does allauth work when user logs in via social registration

IhavebeentryingtousedjangoallauthtoprovideSocialregistration,butIamhavingtrouble configuringtheprofilesfortheuser.Thereisnodocumentationofdjangoallauthwhichtells 1. howadjangouseraccountiscreatedwhenauserlogsinviaathirdpartysuchasfacebook 2. Whatusernameisassignedtothatuserandwhatpasswordisused. 3. CertainthirdpartyproviderssuchasFacebookprovidealotofinformationabouttheusersuchas theirname,emailetc.sohowcanwegetthemandsaveintheuseraccount/profile Ifanybodyhasusedallauthintheirprojectsandcanprovidesomedetailsthenitwouldbereallyhelpful.


django registration social userprofile

askedDec12'11at21:22 Sachin 904 2 20 58%acceptrate feedback

1 Answer
Iamusingdjango_allauthinmyproject. (1)Howadjangouseraccountiscreatedwhenauserlogsinviaathirdpartysuchasfacebook? Youshouldtakealookat: 1. youradminpanelandseewhathappenswhensomebodylogsin. 2. allauth.facebook.views.loginandtrytotracktheloginprocess Itissomethinglikethis(inafewwords): 1. 2. 3. 4. 5. WhenauserlogsinyoursiteviahisFacebookcredentialsheisgivenanaccesstoken ThistokenissavedintheFACEBOOK_ACCESS_TOKENStable(youcanseeitintheadminpanel) WiththisaccesstokenandwiththehelpofFacebookGraphApiweknowhissocial_id Whenweknowhissocial_idwecanhavehisFacebookaccountfromourdatabase Ifwehaven'tsaveditinthedbalreadywesavetheFacebookaccountinthe FACEBOOK_ACCOUNTStable(FacebookAccountsintheadminpanel) 6. ThenwecreateauserintheUSERStablewiththedatapresentintheFacebookaccount.(youcan seethenewuserintheUserssectionintheadminpanel) (2)Whatusernameisassignedtothatuserandwhatpasswordisused? AsImentionedbeforewiththehelpofFacebookGraphApiwegettheusernameoftheFacebookuser anditisassignedtotheUserprofileasUser.username

(3)CertainthirdpartyproviderssuchasFacebookprovidealotofinformationabouttheusersuch astheirname,emailetc.sohowcanwegetthemandsaveintheuseraccount/profile? AgaintheFacebookGraphApiitgetsyoutheinfoyouneed. Ihaveintegrateddjango_allauthinmysiteanditisworkingproperly.Iwillbehappytoanswer(ifIcan)if youhavemorequestions.

EDITFortheavatarsupport... Ithinkyouhavetotakealookatthedjango_allauthsettingsandparticularlyin: SCAACUTAAA_UPR='vtrnstig.NTLE_PS OILCON_VTRSPOT(aaa'ietnsISALDAP)

Enablesupportfordjangoavatar.Whenenabled,theprofileimageoftheuseriscopiedlocallyinto djangoavataratsignup.
editedFeb8at13:33 answeredFeb7at17:21 forbdn 71 4

AlthoughIhadeventuallyfigureditout,butstillthanksalotforalltheinformationthatyouhaveprovided.There isjustonethingIdon'tknowhowtosolve.CurrentlyIgaveconfiguredtheappsuchthatitsgettheimagefrom facebookprofile,butIrealizedthatthisimageisnotsaved,soIftheusertriestochangetheavatarthenthe imagewhichwasbroughtfromsocialauthenticationislost.Isthereawaytoretainthat? Sachin Feb8at 9:32

feedback

Not the answer you're looking for? Browse other questions tagged django registration
social user-profile or ask your own question.

Vous aimerez peut-être aussi