(The following text was extracted from documents at http://psa.matiasaguirre.net/docs/use_cases.html#multiple-scopes-per-provider )
python-social-auth , , , . , , , .
get_scope()
from social.backends.facebook import FacebookOAuth2
class CustomFacebookOAuth2(FacebookOauth2):
def get_scope(self):
scope = super(CustomFacebookOAuth2, self).get_scope()
if self.data.get('extrascope'):
scope += [('foo', 'bar')]
return scope
, , (get_scope()) , , GET POST (self.data).
- FacebookOAuth2 AUTHENTICATION_BACKENDS .
, , , , URL-, ( ) , URL- . , :
from social.backends.facebook import FacebookOAuth2
class CustomFacebookOAuth2(FacebookOauth2):
name = 'facebook-custom'
- , FacebookOAuth2 AUTHENTICATION_BACKENDS. URL-:
/login/facebook-custom
/complete/facebook-custom
/disconnect/facebook-custom
:
SOCIAL_AUTH_FACEBOOK_CUSTOM_KEY = '...'
SOCIAL_AUTH_FACEBOOK_CUSTOM_SECRET = '...'
SOCIAL_AUTH_FACEBOOK_CUSTOM_SCOPE = [...]
, /login/facebook-custom, auth user.social_auth.get(provider='facebook-custom') access_token .