/usr/lib/python3/dist-packages/social/backends/yammer.py is in python3-social-auth 0.2.13-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | """
Yammer OAuth2 production and staging backends, docs at:
http://psa.matiasaguirre.net/docs/backends/yammer.html
"""
from social.backends.oauth import BaseOAuth2
class YammerOAuth2(BaseOAuth2):
name = 'yammer'
AUTHORIZATION_URL = 'https://www.yammer.com/dialog/oauth'
ACCESS_TOKEN_URL = 'https://www.yammer.com/oauth2/access_token'
EXTRA_DATA = [
('id', 'id'),
('expires', 'expires'),
('mugshot_url', 'mugshot_url')
]
def get_user_id(self, details, response):
return response['user']['id']
def get_user_details(self, response):
username = response['user']['name']
fullname, first_name, last_name = self.get_user_names(
fullname=response['user']['full_name'],
first_name=response['user']['first_name'],
last_name=response['user']['last_name']
)
email = response['user']['contact']['email_addresses'][0]['address']
mugshot_url = response['user']['mugshot_url']
return {
'username': username,
'email': email,
'fullname': fullname,
'first_name': first_name,
'last_name': last_name,
'picture_url': mugshot_url
}
class YammerStagingOAuth2(YammerOAuth2):
name = 'yammer-staging'
AUTHORIZATION_URL = 'https://www.staging.yammer.com/dialog/oauth'
ACCESS_TOKEN_URL = 'https://www.staging.yammer.com/oauth2/access_token'
REQUEST_TOKEN_URL = 'https://www.staging.yammer.com/oauth2/request_token'
|