python类build_xoauth_string()的实例源码

imapclient.py 文件源码 项目:sndlatr 作者: Schibum 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def oauth_login(self, url, oauth_token, oauth_token_secret,
                    consumer_key='anonymous', consumer_secret='anonymous'):
        """Authenticate using the OAUTH method.

        This only works with IMAP servers that support OAUTH (e.g. Gmail).
        """
        if oauth_module:
            token = oauth_module.Token(oauth_token, oauth_token_secret)
            consumer = oauth_module.Consumer(consumer_key, consumer_secret)
            xoauth_callable = lambda x: oauth_module.build_xoauth_string(url,
                                                                         consumer,
                                                                         token)
            return self._command_and_check('authenticate', 'XOAUTH',
                                           xoauth_callable, unpack=True)
        else:
            raise self.Error(
                'The optional oauth2 package is needed for OAUTH authentication')
smtp.py 文件源码 项目:Taigabot 作者: FrozenPigs 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def authenticate(self, url, consumer, token):
        if consumer is not None and not isinstance(consumer, oauth2.Consumer):
            raise ValueError("Invalid consumer.")

        if token is not None and not isinstance(token, oauth2.Token):
            raise ValueError("Invalid token.")

        self.docmd('AUTH', 'XOAUTH %s' % \
            base64.b64encode(oauth2.build_xoauth_string(url, consumer, token)))
imap.py 文件源码 项目:Taigabot 作者: FrozenPigs 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def authenticate(self, url, consumer, token):
        if consumer is not None and not isinstance(consumer, oauth2.Consumer):
            raise ValueError("Invalid consumer.")

        if token is not None and not isinstance(token, oauth2.Token):
            raise ValueError("Invalid token.")

        imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH',
            lambda x: oauth2.build_xoauth_string(url, consumer, token))
smtp.py 文件源码 项目:Fetch 作者: bourdakos1 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def authenticate(self, url, consumer, token):
        if consumer is not None and not isinstance(consumer, oauth2.Consumer):
            raise ValueError("Invalid consumer.")

        if token is not None and not isinstance(token, oauth2.Token):
            raise ValueError("Invalid token.")

        self.docmd('AUTH', 'XOAUTH %s' % \
            base64.b64encode(oauth2.build_xoauth_string(url, consumer, token)))
imap.py 文件源码 项目:Fetch 作者: bourdakos1 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def authenticate(self, url, consumer, token):
        if consumer is not None and not isinstance(consumer, oauth2.Consumer):
            raise ValueError("Invalid consumer.")

        if token is not None and not isinstance(token, oauth2.Token):
            raise ValueError("Invalid token.")

        imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH',
            lambda x: oauth2.build_xoauth_string(url, consumer, token))
smtp.py 文件源码 项目:OneClickDTU 作者: satwikkansal 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def authenticate(self, url, consumer, token):
        if consumer is not None and not isinstance(consumer, oauth2.Consumer):
            raise ValueError("Invalid consumer.")

        if token is not None and not isinstance(token, oauth2.Token):
            raise ValueError("Invalid token.")

        self.docmd('AUTH', 'XOAUTH %s' % \
            base64.b64encode(oauth2.build_xoauth_string(url, consumer, token)))
imap.py 文件源码 项目:OneClickDTU 作者: satwikkansal 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def authenticate(self, url, consumer, token):
        if consumer is not None and not isinstance(consumer, oauth2.Consumer):
            raise ValueError("Invalid consumer.")

        if token is not None and not isinstance(token, oauth2.Token):
            raise ValueError("Invalid token.")

        imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH',
            lambda x: oauth2.build_xoauth_string(url, consumer, token))
smtp.py 文件源码 项目:TumblrVideos 作者: moedje 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def authenticate(self, url, consumer, token):
        if consumer is not None and not isinstance(consumer, oauth2.Consumer):
            raise ValueError("Invalid consumer.")

        if token is not None and not isinstance(token, oauth2.Token):
            raise ValueError("Invalid token.")

        self.docmd('AUTH', 'XOAUTH %s' % \
            base64.b64encode(oauth2.build_xoauth_string(url, consumer, token)))
imap.py 文件源码 项目:TumblrVideos 作者: moedje 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def authenticate(self, url, consumer, token):
        if consumer is not None and not isinstance(consumer, oauth2.Consumer):
            raise ValueError("Invalid consumer.")

        if token is not None and not isinstance(token, oauth2.Token):
            raise ValueError("Invalid token.")

        imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH',
            lambda x: oauth2.build_xoauth_string(url, consumer, token))


问题


面经


文章

微信
公众号

扫码关注公众号