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


Python AuthorizationRequest.verify方法代码示例

本文整理汇总了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()
开发者ID:Omosofe,项目名称:pyoidc,代码行数:6,代码来源:test_oauth2_message.py

示例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()
开发者ID:Omosofe,项目名称:pyoidc,代码行数:6,代码来源:test_oauth2_message.py

示例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
开发者ID:takehikokodama,项目名称:pyoidc,代码行数:31,代码来源:provider.py


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