【问题标题】:pysaml2 usage - Missing entity_id specificationpysaml2 用法 - 缺少 entity_id 规范
【发布时间】: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 上运行。

【问题讨论】:

    标签: python saml saml-2.0


    【解决方案1】:

    部分答案:pysaml2 想要一个额外的参数:

    settings = {
            'metadata': {
                'inline': [idp_metadata],
            },
            'entityid': ...
    

    文档太糟糕了,目前还不清楚这是否是一个完整的解决方案。

    【讨论】:

      猜你喜欢
      • 2015-11-05
      • 1970-01-01
      • 2014-07-22
      • 1970-01-01
      • 1970-01-01
      • 2015-03-02
      • 1970-01-01
      • 1970-01-01
      • 2012-07-19
      相关资源
      最近更新 更多