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


Python RegistrationRequest.keys方法代码示例

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


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

示例1: test_registration_endpoint_openid4us

# 需要导入模块: from oic.oic.message import RegistrationRequest [as 别名]
# 或者: from oic.oic.message.RegistrationRequest import keys [as 别名]
    def test_registration_endpoint_openid4us(self):
        req = RegistrationRequest(
            **{'token_endpoint_auth_method': u'client_secret_post',
               'redirect_uris': [
                   u'https://connect.openid4.us:5443/phpRp/index.php/callback',
                   u'https://connect.openid4.us:5443/phpRp/authcheck.php/authcheckcb'],
               'jwks_uri': u'https://connect.openid4.us:5443/phpRp/rp/rp.jwk',
               'userinfo_encrypted_response_alg': u'RSA1_5',
               'contacts': [u'[email protected]'],
               'userinfo_encrypted_response_enc': u'A128CBC-HS256',
               'application_type': u'web',
               'client_name': u'ABRP-17',
               'grant_types': [u'authorization_code', u'implicit'],
               'post_logout_redirect_uris': [
                   u'https://connect.openid4.us:5443/phpRp/index.php/logoutcb'],
               'subject_type': u'public',
               'response_types': [u'code', u'token', u'id_token', u'code token',
                                  u'code id_token', u'id_token token',
                                  u'code id_token token'],
               'policy_uri': u'https://connect.openid4.us:5443/phpRp/index.php/policy',
               'logo_uri': u'https://connect.openid4.us:5443/phpRp/media/logo.png'})

        resp = self.provider.registration_endpoint(request=req.to_json())

        regresp = RegistrationResponse().deserialize(resp.message, "json")
        assert _eq(regresp.keys(), list(req.keys()) +
                   ['registration_client_uri',
                    'client_secret_expires_at',
                    'registration_access_token',
                    'client_id', 'client_secret',
                    'client_id_issued_at'])
开发者ID:joostd,项目名称:pyoidc,代码行数:33,代码来源:test_oic_provider.py

示例2: l_registration_endpoint

# 需要导入模块: from oic.oic.message import RegistrationRequest [as 别名]
# 或者: from oic.oic.message.RegistrationRequest import keys [as 别名]
    def l_registration_endpoint(self, request, authn=None, **kwargs):
        _log_debug = logger.debug
        _log_info = logger.info

        _log_debug("@registration_endpoint")

        request = RegistrationRequest().deserialize(request, "json")

        _log_info("registration_request:%s" % request.to_dict())
        resp_keys = request.keys()

        try:
            request.verify()
        except MessageException, err:
            if "type" not in request:
                return self._error(error="invalid_type", 
                                   descr="%s" % err)
            else:
                return self._error(error="invalid_configuration_parameter",
                                   descr="%s" % err)
开发者ID:wayward710,项目名称:pyoidc,代码行数:22,代码来源:provider.py

示例3: test_deserialize

# 需要导入模块: from oic.oic.message import RegistrationRequest [as 别名]
# 或者: from oic.oic.message.RegistrationRequest import keys [as 别名]
    def test_deserialize(self):
        msg = {
            "application_type": "web",
            "redirect_uris": ["https://client.example.org/callback",
                              "https://client.example.org/callback2"],
            "client_name": "My Example",
            "client_name#ja-Jpan-JP": "クライアント名",
            "logo_uri": "https://client.example.org/logo.png",
            "subject_type": "pairwise",
            "sector_identifier_uri":
                "https://other.example.net/file_of_redirect_uris.json",
            "token_endpoint_auth_method": "client_secret_basic",
            "jwks_uri": "https://client.example.org/my_public_keys.jwks",
            "userinfo_encrypted_response_alg": "RSA1_5",
            "userinfo_encrypted_response_enc": "A128CBC+HS256",
            "contacts": ["[email protected]", "[email protected]"],
            "request_uris": [
                "https://client.example.org/rf.txt"
                "#qpXaRLh_n93TTR9F252ValdatUQvQiJi5BDub2BeznA"]
        }

        reg = RegistrationRequest().deserialize(json.dumps(msg), "json")
        assert _eq(msg.keys(), reg.keys())
开发者ID:joostd,项目名称:pyoidc,代码行数:25,代码来源:test_oic_message.py


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