class BaseAuth(object):
"""Base authentication class, new authenticators should subclass
- and implement needed methods"""
+ and implement needed methods.
+
+ @AUTH_BACKEND Authorization backend related with this service
+ """
+ AUTH_BACKEND = None
+
def __init__(self, request, redirect):
self.request = request
self.data = request.POST if request.method == 'POST' else request.GET
class OpenIdAuth(BaseAuth):
- """
- OpenId process handling
- @AUTH_BACKEND Authorization backend related with this service
- """
+ """OpenId process handling"""
AUTH_BACKEND = OpenIDBackend
def auth_url(self):
@REQUEST_TOKEN_URL Request token URL
@ACCESS_TOKEN_URL Access token URL
@SERVER_URL Authorization server URL
- @AUTH_BACKEND Authorization backend related with
- this service
"""
AUTHORIZATION_URL = ''
REQUEST_TOKEN_URL = ''
ACCESS_TOKEN_URL = ''
SERVER_URL = ''
- AUTH_BACKEND = None
SETTINGS_KEY_NAME = ''
SETTINGS_SECRET_NAME = ''
class FacebookAuth(BaseOAuth):
"""Facebook OAuth mechanism"""
+ AUTH_BACKEND = FacebookBackend
+
def auth_url(self):
"""Returns redirect url"""
args = {'client_id': settings.FACEBOOK_APP_ID,
REQUEST_TOKEN_URL = GOOGLE_REQUEST_TOKEN_URL
ACCESS_TOKEN_URL = GOOGLE_ACCESS_TOKEN_URL
SERVER_URL = GOOGLE_SERVER
- AUTH_BACKEND = None
def user_data(self, access_token):
"""Loads user data from G service"""