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


Python IdPConfig.context方法代码示例

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


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

示例1: test_idp_1

# 需要导入模块: from saml2.config import IdPConfig [as 别名]
# 或者: from saml2.config.IdPConfig import context [as 别名]
def test_idp_1():
    c = IdPConfig().load(IDP1)
    c.context = "idp"

    print c
    assert c.endpoint("single_sign_on_service")[0] == 'http://localhost:8088/'

    attribute_restrictions = c.getattr("policy","idp").get_attribute_restriction("")
    assert attribute_restrictions["eduPersonAffiliation"][0].match("staff")
开发者ID:paulftw,项目名称:pysaml2,代码行数:11,代码来源:test_31_config.py

示例2: test_idp_2

# 需要导入模块: from saml2.config import IdPConfig [as 别名]
# 或者: from saml2.config.IdPConfig import context [as 别名]
def test_idp_2():
    c = IdPConfig().load(IDP2)
    c.context = "idp"

    print(c)
    assert c.endpoint("single_logout_service", BINDING_SOAP) == []
    assert c.endpoint("single_logout_service", BINDING_HTTP_REDIRECT) == ["http://localhost:8088/"]

    attribute_restrictions = c.getattr("policy", "idp").get_attribute_restrictions("")
    assert attribute_restrictions["edupersonaffiliation"][0].match("staff")
开发者ID:rohe,项目名称:pysaml2-3,代码行数:12,代码来源:test_31_config.py

示例3: test_assertion_consumer_service

# 需要导入模块: from saml2.config import IdPConfig [as 别名]
# 或者: from saml2.config.IdPConfig import context [as 别名]
def test_assertion_consumer_service():
    c = IdPConfig()
    c.load_file(dotname("idp_conf"))
    c.context = "idp"

    c.metadata.load("local", full_path("InCommon-metadata.xml"))

    entity_id = "https://www.zimride.com/shibboleth"
    acs = c.metadata.assertion_consumer_service(entity_id)
    assert len(acs) == 1
    assert acs[0]["location"] == 'https://www.zimride.com/Shibboleth.sso/SAML2/POST'
开发者ID:mlepine,项目名称:pysaml2,代码行数:13,代码来源:test_31_config.py

示例4: test_assertion_consumer_service

# 需要导入模块: from saml2.config import IdPConfig [as 别名]
# 或者: from saml2.config.IdPConfig import context [as 别名]
def test_assertion_consumer_service():
    c = IdPConfig()
    c.load_file("idp_conf")
    c.context = "idp"

    xml_src = open("inCommon-metadata.xml").read()
    # A trick so outdated data is allowed
    c.metadata.import_metadata(xml_src, "-")

    print c.metadata.entity.keys()
    entity_id = "https://www.zimride.com/shibboleth"
    acs = c.assertion_consumer_services(entity_id)
    assert len(acs) == 1
    assert acs[0].location == 'https://www.zimride.com/Shibboleth.sso/SAML2/POST'
开发者ID:paulftw,项目名称:pysaml2,代码行数:16,代码来源:test_31_config.py


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