oauth2.py 文件源码

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

项目:Sanic-OAuth 作者: Sniedes722 项目源码 文件源码
def validate_refresh_token(self, refresh_token, client, request,
                               *args, **kwargs):
        """Ensure the token is valid and belongs to the client
        This method is used by the authorization code grant indirectly by
        issuing refresh tokens, resource owner password credentials grant
        (also indirectly) and the refresh token grant.
        """

        token = self._tokengetter(refresh_token=refresh_token)

        if token and token.client_id == client.client_id:
            # Make sure the request object contains user and client_id
            request.client_id = token.client_id
            request.user = token.user
            return True
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号