Suggestion needed: user registration without a username but with email + Facebook authentication + Linking profiles together + REST API

27 views
Skip to first unread message

Andrey Shipilov

unread,
Jul 13, 2015, 3:38:41 AM7/13/15
to django...@googlegroups.com
Hey guys, I have tried several approaches and kinda stuck now. I have tried using django-allauth, django-rest-auth, djangorestframework, python-social-auth and such.

Basically I have these requirements for a project I am building.
  • It's an iOS/Android app, so it needs to have RESTful API.
  • Users should be able to register using Email, Password. They don't need to have a username.
  • Users also need to have extended profiles to store First name, Last name, Profile picture e.t.c. (I tried both subclassing AbstractBaseUser and having a generic User as a OneToOne field)
  • Users should be able to log in using Facebook authentication.
  • Active users should be able to Connect with Facebook any time after the registration for them to be able to use Facebook extended permissions from the mobile app.
Basically, the problems that I had trying to accomplish that are these ones.
  • There ARE examples for django-allauth on how to have users with emails instead of username for primary identifier. But...
  • ...when requesting a Facebook token and trying to authorize a user NOT all of them have emails on their public profiles. Apparently it happens if the emails is not confirmed, or some other trickery with the Facebook settings.
  • This results in creating Users with neither email or username. Creating another Users using Facebook results in IntegrityError because the user created before has no username filled in obviously.
  • At some scenarios allauth throws an error "User doesn't have a backend" but sometimes it doesn't. I couldn't properly catch that.
If anyone could give me a direction which packages to use to accomplish what I need I would really appreciate that. If there are working examples for that — that would be the best.

Thanks ahead.
Reply all
Reply to author
Forward
0 new messages