本文整理汇总了Python中oic.oauth2.message.AuthorizationRequest.to_dict方法的典型用法代码示例。如果您正苦于以下问题:Python AuthorizationRequest.to_dict方法的具体用法?Python AuthorizationRequest.to_dict怎么用?Python AuthorizationRequest.to_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.oauth2.message.AuthorizationRequest
的用法示例。
在下文中一共展示了AuthorizationRequest.to_dict方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: except
# 需要导入模块: from oic.oauth2.message import AuthorizationRequest [as 别名]
# 或者: from oic.oauth2.message.AuthorizationRequest import to_dict [as 别名]
# verify the redirect_uri
try:
self.get_redirect_uri(areq)
except (RedirectURIError, ParameterError), err:
return self._error("invalid_request", "%s" % err)
except Exception, err:
message = traceback.format_exception(*sys.exc_info())
logger.error(message)
logger.debug("Bad request: %s (%s)" % (err, err.__class__.__name__))
return BadRequest("%s" % err)
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