本文整理汇总了Python中oauthlib.common.Request.client_id方法的典型用法代码示例。如果您正苦于以下问题:Python Request.client_id方法的具体用法?Python Request.client_id怎么用?Python Request.client_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oauthlib.common.Request
的用法示例。
在下文中一共展示了Request.client_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_request_invalid_client_id
# 需要导入模块: from oauthlib.common import Request [as 别名]
# 或者: from oauthlib.common.Request import client_id [as 别名]
def test_request_invalid_client_id(self):
request = Request('https://a.b./path')
request.scope = 'openid profile'
request.response_type = 'code'
with pytest.raises(errors.MissingClientIdError):
self.auth.validate_authorization_request(request)
request.client_id = 'invalid_client'
self.validator.validate_client_id.return_value = False
with pytest.raises(errors.InvalidClientIdError):
self.auth.validate_authorization_request(request)
示例2: make_request
# 需要导入模块: from oauthlib.common import Request [as 别名]
# 或者: from oauthlib.common.Request import client_id [as 别名]
def make_request(self, response_type='code',
scope='openid profile email', **kwargs):
request = Request('https://a.b/path')
request.scope = scope
request.client = 'superman'
request.client_id = 'abcdef'
request.redirect_uri = 'https://a.b/'
request.response_type = response_type
for prop, val in kwargs.items():
setattr(request, prop, val)
return request