Use python / django so that users can log in to my site using their google credentials.

I want users to use their google account to log in to my site. That is how SO allows me. Can someone point in the right direction? I assume that you need to use the oAuth library, but what I really liked is a piece of code that I can copy to a folder and make it work.

+3
source share
3 answers

This is not OAuth, in particular, what you need (OAuth is designed to authorize access for one website to specific private content stored on another), but OpenID - which is for authentication, not authorization. (Some sites, such as Twitter, provide authentication services through OAuth, but this is not what it is primarily for.) I used python-openid , which is pretty simple, or you can look at django-openid - although it assumes that it incomplete, you can get an idea of ​​how to implement OpenID support.

The problem is a bit related to recognizing a copy and paste solution, but it is not particularly difficult to do.

Update: The piquadrat link (in the comments) is definitely worth it.

+3

django-piston, - oAuth. , .

+1

You can use Django-Socialauth as it supports

  • Twitter
  • Gmail
  • Facebook
  • Yahoo (mostly openid)
  • Openid
+1
source

Source: https://habr.com/ru/post/1745750/


All Articles