Commit 9a1687ab by David Ormsbee Committed by Julia Hansbrough

Facebook auth support.

parent b371783e
...@@ -4,7 +4,7 @@ Loaded by Django's settings mechanism. Consequently, this module must not ...@@ -4,7 +4,7 @@ Loaded by Django's settings mechanism. Consequently, this module must not
invoke the Django armature. invoke the Django armature.
""" """
from social.backends import google, linkedin from social.backends import google, linkedin, facebook
_DEFAULT_ICON_CLASS = 'icon-signin' _DEFAULT_ICON_CLASS = 'icon-signin'
...@@ -150,6 +150,26 @@ class LinkedInOauth2(BaseProvider): ...@@ -150,6 +150,26 @@ class LinkedInOauth2(BaseProvider):
return provider_details.get('fullname') return provider_details.get('fullname')
class FacebookOauth2(BaseProvider):
"""Provider for LinkedIn's Oauth2 auth system."""
BACKEND_CLASS = facebook.FacebookOAuth2
ICON_CLASS = 'icon-facebook'
NAME = 'Facebook'
SETTINGS = {
'SOCIAL_AUTH_FACEBOOK_KEY': None,
'SOCIAL_AUTH_FACEBOOK_SECRET': None,
}
@classmethod
def get_email(cls, provider_details):
return provider_details.get('email')
@classmethod
def get_name(cls, provider_details):
return provider_details.get('fullname')
class Registry(object): class Registry(object):
"""Singleton registry of third-party auth providers. """Singleton registry of third-party auth providers.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment