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


Python Consumer.contact方法代码示例

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


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

示例1: test_client_register_token

# 需要导入模块: from oic.oic.consumer import Consumer [as 别名]
# 或者: from oic.oic.consumer.Consumer import contact [as 别名]
    def test_client_register_token(self):
        c = Consumer(None, None)

        c.application_type = "web"
        c.application_name = "My super service"
        c.redirect_uris = ["https://example.com/authz"]
        c.contact = ["[email protected]"]

        client_info = {"client_id": "clientid", "redirect_uris": ["https://example.com/authz"]}

        with responses.RequestsMock() as rsps:
            rsps.add(rsps.POST, "https://provider.example.com/registration/", json=client_info)
            c.register("https://provider.example.com/registration/", registration_token="initial_registration_token")
            header = rsps.calls[0].request.headers['Authorization'].decode()
            assert header == "Bearer aW5pdGlhbF9yZWdpc3RyYXRpb25fdG9rZW4="
开发者ID:,项目名称:,代码行数:17,代码来源:

示例2: test_client_register

# 需要导入模块: from oic.oic.consumer import Consumer [as 别名]
# 或者: from oic.oic.consumer.Consumer import contact [as 别名]
    def test_client_register(self, fake_oic_server):
        c = Consumer(None, None)

        c.application_type = "web"
        c.application_name = "My super service"
        c.redirect_uris = ["https://example.com/authz"]
        c.contact = ["[email protected]"]
        mfos = fake_oic_server("https://example.com")
        mfos.keyjar = SRVKEYS
        c.http_request = mfos.http_request
        location = c.discover("[email protected]")
        info = c.provider_config(location)

        c.register(info["registration_endpoint"])
        assert c.client_id is not None
        assert c.client_secret is not None
        assert c.registration_expires > utc_time_sans_frac()
开发者ID:,项目名称:,代码行数:19,代码来源:


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