def callback(self):
if 'code' not in request.args:
return None, None, None
oauth_session = self.service.get_auth_session(
data={'code': request.args['code'],
'grant_type': 'authorization_code',
'redirect_uri': self.get_callback_url()},
decoder=json.loads
)
me = oauth_session.get('/api/v1/user.json').json()
return (
me.get('data').get('id'),
me.get('data').get('first_name'),
me.get('data').get('email')
)
评论列表
文章目录