【发布时间】:2021-02-10 21:54:37
【问题描述】:
初始化 pysaml2 客户端的正确数据格式是什么?图书馆抱怨 Missing entity_id specification,尽管 xml 中有一个 entityID(如下)。
spConfig = Saml2Config()
spConfig.load({
'metadata': {
'inline': [idp_metadata],
},
'service': {
'sp': {
'endpoints': {
'assertion_consumer_service': [
(acs_url, BINDING_HTTP_REDIRECT),
(acs_url, BINDING_HTTP_POST),
(https_acs_url, BINDING_HTTP_REDIRECT),
(https_acs_url, BINDING_HTTP_POST)
],
},
# Don't verify that the incoming requests originate from us via
# the built-in cache for authn request ids in pysaml2
'allow_unsolicited': True,
# Don't sign authn requests, since signed requests only make
# sense in a situation where you control both the SP and IdP
'authn_requests_signed': False,
'logout_requests_signed': True,
'want_assertions_signed': True,
'want_response_signed': False,
},
},
})
saml_client = Saml2Client(config=spConfig)
XML:
<?xml version="1.0" encoding="UTF-8"?>
<md:EntityDescriptor
entityID="http://www.okta.com/[redacted]"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata">
...
库版本是最新的。 python 3.10 在 macOS Catalina 上运行。
【问题讨论】: