This is a fork to rollup other forks of this app and try to get it running with the most recent facebook/twitter/linkedin APIs. It is completely untested. Just thought I'd share the work while it's in-progress. It's supposed to allow logging in via Facebook, Yahoo, Gmail, Twitter and Openid.
It's sad that Rails has such a complete solution with omniauth -- Django has nothing to compare! I'm hoping we all rally around one of these projects to create our own omniauth. I'm not sure this is the best code base to start from. I'm also exploring the following:
- https://github.com/flashingpumpkin/django-socialregistration (note the forks)
- https://github.com/zbowling/python-oauth2 (good fork of simplegeo's)
What it does
- Allow logging in via various providers.
- Import contacts from various third party sites, to find out which of your friends already use our service.
This is a application to enable authentication via various third party sites. In particular it allows logging in via
- Yahoo(Essentially openid)
Libs you need to install See requirements.txt use pip install -r requirements.txt to install all dependencies at once Note that you will probably require git and mercurial installed for pip to fetch the requirements.
The API Keys are available from
How it works.
- Openid: Users need to provide their openid providers. Talk to the providers and login.
- Yahoo: Yahoo is an openid provider. Talk to Yahoo endpoints. (Endpoint: http://yahoo.com)
- Google: Google is a provider. Talk to them. (Endpoint: https://www.google.com/accounts/o8/id)
- Facebook: Facebook connect provides authentication framework.
- Twitter: We use Twitter Oauth for authentication. In theory, Oauth shouldn't be used for authentication. (It is an autorisation framework, not an authentication one), In practice it works pretty well. Once you have an access_token, and a name, essentially authenticated.
As with all APIs, we are limited by the amout of data which the API provider provides us. For example, both Yahoo and Google provide extremely limited data about the autheticated subscriber. Twitter and Facebook provide a lot of details, but not the email. Different Openid providers are free to provide [different amounts of data](http://openid.net/specs/openid-simple-registration-extension-1_0.html).
How it works.
- For all providers(except Facebook) there are two urls and views. (start and done)
- Start sets up the required tokens, and redirects and hands off to the correct provider.
- Provider handles authentication on their ends, and hands off to Us, providing authorization tokens.
- In done, we check if the user with these details already exists, if yes, we log them in. Otherwise we create a new user, and log them in.
For all of these, we use standard django authenication system, with custom auth_backends, hence all existing views, and decorators as login_required will work as expected.
- /login/ Login page. Has all the login options
- /openid_login/ AND /openid_login/done/
- /yahoo_login/ AND /yahoo_login/done/
- /gmail_login/ AND /gmail_login/done/
- /twitter_login/ AND /twitter_login/done/
- /facebook_login/done/ We dont have a start url here, as the starting tokens are set in a popup.
- Install required libraries.
- Get tokens and populate in localsettings.py
- Set the token callback urls correctly at Twitter and Facebook.
- Set the authentication_backends to the providers you are using.