oauth.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:flask_boilerplate 作者: sakib 项目源码 文件源码
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')
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号