本文整理匯總了Python中saml2.config.IdPConfig.load_file方法的典型用法代碼示例。如果您正苦於以下問題:Python IdPConfig.load_file方法的具體用法?Python IdPConfig.load_file怎麽用?Python IdPConfig.load_file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類saml2.config.IdPConfig
的用法示例。
在下文中一共展示了IdPConfig.load_file方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_assertion_consumer_service
# 需要導入模塊: from saml2.config import IdPConfig [as 別名]
# 或者: from saml2.config.IdPConfig import load_file [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'
示例2: test_assertion_consumer_service
# 需要導入模塊: from saml2.config import IdPConfig [as 別名]
# 或者: from saml2.config.IdPConfig import load_file [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'