0

I have a web app which is based on django (version 2.0+), the user can only login with third party authentication.

My question is like, can I still use the technique like:

  if request.user.is_authenticated():

(source: How to check if a user is logged in (how to properly use user.is_authenticated)?)

to see if user is logged in?

Some background: After third party login, user profile is available. At the moment the structure of the database is still at design phase.

dirkgroten
  • 20,112
  • 2
  • 29
  • 42
Rudy
  • 21
  • 3
  • Yes, you should implement an authentication backend that uses your 3rd party API to authenticate users instead of the default username/password authentication Django provides. Read [this](https://docs.djangoproject.com/en/stable/topics/auth/customizing/#other-authentication-sources) to find out more. – dirkgroten Sep 09 '19 at 11:53
  • the document is exactly what I need, Thanks so much. :) – Rudy Sep 09 '19 at 12:36

0 Answers0