本文整理汇总了Python中oic.oauth2.message.AuthorizationRequest.verify方法的典型用法代码示例。如果您正苦于以下问题:Python AuthorizationRequest.verify方法的具体用法?Python AuthorizationRequest.verify怎么用?Python AuthorizationRequest.verify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.oauth2.message.AuthorizationRequest
的用法示例。
在下文中一共展示了AuthorizationRequest.verify方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_urlencoded_missing_required
# 需要导入模块: from oic.oauth2.message import AuthorizationRequest [as 别名]
# 或者: from oic.oauth2.message.AuthorizationRequest import verify [as 别名]
def test_urlencoded_missing_required(self):
ar = AuthorizationRequest(response_type=["code"])
with pytest.raises(MissingRequiredAttribute):
ar.verify()
示例2: test_verify
# 需要导入模块: from oic.oauth2.message import AuthorizationRequest [as 别名]
# 或者: from oic.oauth2.message.AuthorizationRequest import verify [as 别名]
def test_verify(self):
query = 'redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fauthz&response_type=code&client_id=0123456789'
ar = AuthorizationRequest().deserialize(query, "urlencoded")
assert ar.verify()
示例3: except
# 需要导入模块: from oic.oauth2.message import AuthorizationRequest [as 别名]
# 或者: from oic.oauth2.message.AuthorizationRequest import verify [as 别名]
if not areq:
logger.debug("No AuthzRequest")
return self._error("invalid_request", "No parsable AuthzRequest")
logger.debug("AuthzRequest: %s" % (areq.to_dict(),))
try:
redirect_uri = self.get_redirect_uri(areq)
except (RedirectURIError, ParameterError), err:
return self._error("invalid_request", "%s" % err)
except UnknownClient, err:
return self._error("unauthorized_client", "%s" % err)
try:
# verify that the request message is correct
areq.verify()
except (MissingRequiredAttribute, ValueError), err:
return self._redirect_authz_error("invalid_request", redirect_uri,
"%s" % err)
# Check if the person is already authenticated
a_args = {}
if cookie:
logger.debug("Cookie: %s" % cookie)
a_args["cookie"] = cookie
if authn:
try:
a_args["authorization"] = authn
except KeyError:
pass