checkers.py 文件源码

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

项目:fluiddb 作者: fluidinfo 项目源码 文件源码
def requestAvatarId(self, credentials):
        """
        Return the avatar ID of the avatar which can be accessed using the
        given OAuth credentials.

        @param credentials: A L{IOAuth2Credentials} that contains OAuth
            credentials.
        @raise UnauthorizedLogin: Raised if the OAuth credentials don't match
            the L{User}'s.
        """
        try:
            session = yield self.facadeClient.authenticateUserWithOAuth2(
                credentials)
        except TPasswordIncorrect:
            logging.info('Bad OAuth credentials: %r:%r' %
                         (credentials.consumerKey, '<sanitized>'))
            raise error.UnauthorizedLogin('Invalid credentials')
        except Exception:
            logging.info('requestAvatarId exception authenticating %r/%r.' %
                         (credentials.consumerKey, '<sanitized>'))
            raise
        else:
            defer.returnValue(session)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号