【问题标题】:djangosaml2idp problems with launch: saml2.sigver.MissingKey: http://localhost:8000/saml2/metadata/djangosaml2idp 启动问题:saml2.sigver.MissingKey:http://localhost:8000/saml2/metadata/
【发布时间】:2022-01-26 10:14:00
【问题描述】:

我一直在尝试启动项目(example_setup 文件夹):

https://github.com/OTA-Insight/djangosaml2idp/tree/master/example_setup

我可以根据文档向任何人回答。但它不起作用。第一个问题,因为我不知道 SP(idp_metadata.xml)- validUntil="2020-12-27T12:41:18Z"> 中的元数据日期。暂时无效,改为未来日期,如example(validUntil="2030-12-27T12:41:18Z")。但是接下来我在浏览器中尝试登录SP(localhost:8000) 时遇到了另一个问题,我遇到了更多问题:

Error during SAML2 authentication
IncorrectlySigned

在寻找问题的过程中,我找到了问题发生的地方。原来它是在 tryexcept 块中,不容易找到。

Traceback (most recent call last):
  File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/djangosaml2idp/views.py", line 251, in get
    req_info = idp_server.parse_authn_request(request.session['SAMLRequest'], binding)
  File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/server.py", line 238, in parse_authn_request
    return self._parse_request(enc_request, AuthnRequest,
  File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/entity.py", line 1036, in _parse_request
    _request = _request.loads(xmlstr, binding, origdoc=enc_request,
  File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/request.py", line 110, in loads
    return self._loads(xmldata, binding, origdoc, must,
  File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/request.py", line 51, in _loads
    print(self.signature_check(xmldata, origdoc=origdoc,
  File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/sigver.py", line 1662, in correctly_signed_authn_request
    return self.correctly_signed_message(decoded_xml, 'authn_request', must, origdoc, only_valid_cert=only_valid_cert)
  File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/sigver.py", line 1653, in correctly_signed_message
    return self._check_signature(
  File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/sigver.py", line 1503, in _check_signature
    raise MissingKey(_issuer)
saml2.sigver.MissingKey: http://localhost:8000/saml2/metadata/
Internal Server Error: /idp/login/process/

缺少一些键:

Error during SAML2 authentication
MissingKey
http://localhost:8000/saml2/metadata/

我在SP中的idp_metada就像在项目的[example_setup][1]文件夹中,只有validUntil已经改变,如上所述,IDP中的用户已被创建为超级用户,我也尝试在SP中创建用户,与 IDP 中相同,但没有任何变化

谁能回答我,我的问题是什么?

【问题讨论】:

    标签: python django saml-2.0 django-saml2-auth


    【解决方案1】:

    文档中没有任何信息。但是您需要从管理面板在 IDP 中创建 SP。这解决了我的问题。

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2019-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-04
    • 2022-07-18
    • 1970-01-01
    相关资源
    最近更新 更多