Пример #1
0
 def get_handler(self):
     from linked_accounts.handlers import AuthHandler
     return AuthHandler.get_handler(self.service)
Пример #2
0
 def authenticate(self, service=None, token=None, expires=None):
     if isinstance(token, basestring) and service in ['facebook', 'google']:
         token = OAuth20Token(token, expires)
     handler = AuthHandler.get_handler(service)
     return handler.get_profile(token)
Пример #3
0
 def get_handler(self):
     from linked_accounts.handlers import AuthHandler
     return AuthHandler.get_handler(self.service)
Пример #4
0
 def link_profile_to_user(self):
     profile = AuthHandler.get_handler(self.access.SERVICE).get_profile(self.token)
     if not profile.user:
         profile.user = self.request.user
         profile.save()
     return profile