oauth2.py 文件源码

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

项目:python-group-proj 作者: Sharcee 项目源码 文件源码
def _data_for_exchange(self, code=None, username=None, password=None, scope=None, user_id=None):
        client_params = {
            "client_id": self.api.client_id,
            "client_secret": self.api.client_secret,
            "redirect_uri": self.api.redirect_uri,
            "grant_type": "authorization_code"
        }
        if code:
            client_params.update(code=code)
        elif username and password:
            client_params.update(username=username,
                                 password=password,
                                 grant_type="password")
            if scope:
                client_params.update(scope=' '.join(scope))
        elif user_id:
            client_params.update(user_id=user_id)
        return urlencode(client_params)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号