当前位置: 首页>>代码示例>>Python>>正文


Python oauth1.SIGNATURE_HMAC属性代码示例

本文整理汇总了Python中oauthlib.oauth1.SIGNATURE_HMAC属性的典型用法代码示例。如果您正苦于以下问题:Python oauth1.SIGNATURE_HMAC属性的具体用法?Python oauth1.SIGNATURE_HMAC怎么用?Python oauth1.SIGNATURE_HMAC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在oauthlib.oauth1的用法示例。


在下文中一共展示了oauth1.SIGNATURE_HMAC属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from oauthlib import oauth1 [as 别名]
# 或者: from oauthlib.oauth1 import SIGNATURE_HMAC [as 别名]
def __init__(self, client_key,
            client_secret=None,
            resource_owner_key=None,
            resource_owner_secret=None,
            callback_uri=None,
            signature_method=SIGNATURE_HMAC,
            signature_type=SIGNATURE_TYPE_AUTH_HEADER,
            rsa_key=None, verifier=None,
            decoding='utf-8',
            client_class=None,
            force_include_body=False,
            **kwargs):

        try:
            signature_type = signature_type.upper()
        except AttributeError:
            pass

        client_class = client_class or self.client_class

        self.force_include_body = force_include_body

        self.client = client_class(client_key, client_secret, resource_owner_key,
            resource_owner_secret, callback_uri, signature_method,
            signature_type, rsa_key, verifier, decoding=decoding, **kwargs) 
开发者ID:kylebebak,项目名称:Requester,代码行数:27,代码来源:oauth1_auth.py

示例2: unauthorized_token_request

# 需要导入模块: from oauthlib import oauth1 [as 别名]
# 或者: from oauthlib.oauth1 import SIGNATURE_HMAC [as 别名]
def unauthorized_token_request(self):
        """Return request for unauthorized token (first stage)"""

        params = self.request_token_extra_arguments()
        params.update(self.get_scope_argument())
        key, secret = self.get_key_and_secret()
        # decoding='utf-8' produces errors with python-requests on Python3
        # since the final URL will be of type bytes
        decoding = None if six.PY3 else 'utf-8'
        state = self.get_or_create_state()
        auth = OAuth1(
            key,
            secret,
            callback_uri=self.get_redirect_uri(state),
            decoding=decoding,
            signature_method=SIGNATURE_HMAC,
            signature_type=SIGNATURE_TYPE_QUERY
        )
        url = self.REQUEST_TOKEN_URL + '?' + urlencode(params)
        url, _, _ = auth.client.sign(url)
        return url 
开发者ID:BeanWei,项目名称:Dailyfresh-B2C,代码行数:23,代码来源:khanacademy.py

示例3: oauth_auth

# 需要导入模块: from oauthlib import oauth1 [as 别名]
# 或者: from oauthlib.oauth1 import SIGNATURE_HMAC [as 别名]
def oauth_auth(self, token=None, oauth_verifier=None):
        key, secret = self.get_key_and_secret()
        oauth_verifier = oauth_verifier or self.data.get('oauth_verifier')
        token = token or {}
        # decoding='utf-8' produces errors with python-requests on Python3
        # since the final URL will be of type bytes
        decoding = None if six.PY3 else 'utf-8'
        state = self.get_or_create_state()
        return OAuth1(key, secret,
                      resource_owner_key=token.get('oauth_token'),
                      resource_owner_secret=token.get('oauth_token_secret'),
                      callback_uri=self.get_redirect_uri(state),
                      verifier=oauth_verifier,
                      signature_method=SIGNATURE_HMAC,
                      signature_type=SIGNATURE_TYPE_QUERY,
                      decoding=decoding) 
开发者ID:BeanWei,项目名称:Dailyfresh-B2C,代码行数:18,代码来源:khanacademy.py

示例4: allowed_signature_methods

# 需要导入模块: from oauthlib import oauth1 [as 别名]
# 或者: from oauthlib.oauth1 import SIGNATURE_HMAC [as 别名]
def allowed_signature_methods(self):
        """Allowed signature methods.

        Default value: SIGNATURE_HMAC and SIGNATURE_RSA.

        You can customize with Flask Config:

            - OAUTH1_PROVIDER_SIGNATURE_METHODS
        """
        return self._config.get(
            'OAUTH1_PROVIDER_SIGNATURE_METHODS',
            SIGNATURE_METHODS,
        ) 
开发者ID:gita,项目名称:BhagavadGita,代码行数:15,代码来源:oauth1.py


注:本文中的oauthlib.oauth1.SIGNATURE_HMAC属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。