【发布时间】: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