Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/saml2/login Error #409

Open
TimH04 opened this issue Nov 13, 2024 · 0 comments
Open

/saml2/login Error #409

TimH04 opened this issue Nov 13, 2024 · 0 comments

Comments

@TimH04
Copy link

TimH04 commented Nov 13, 2024

Hello guys
We are going to use your library in our django project. Now we found a bug with the /saml2/login function.
On a local environment the saml2 signing works but on our kubernetes cluster we get an error.
But the error is just a "standard" error and does not provide information how to fix problem.
We are using the Alpine 3.17 Base Image and installed xmlsec and xmlsec-dev. The environment should be mostly the same.
The Djangosaml2version is 1.9.3.

Error

['/usr/bin/xmlsec1', '--sign', '--privkey-pem', '/app/backend/certificate/key_certificate.key', '--id-attr:ID', 'urn:oasis:names:tc:SAML:2.0:protocol:AuthnRequest', '--node-id', 'id-UKNHXCEIiZusmqSbT', '--output', '/tmp/tmp750au002.xml', '--lax-key-search', '/tmp/tmp9__60ipk.xml']`
saml2.sigver.XmlsecError: returncode=1
error=Signature status: ERROR
Error: failed to sign file "/tmp/tmp9__60ipk.xml"
output=


The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "/usr/local/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/utils/decorators.py", line 46, in _wrapper
    return bound_method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/djangosaml2/views.py", line 89, in wrapper
    return csp_handler(view)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/djangosaml2/views.py", line 367, in get
    session_id, request_xml = client.create_authn_request(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saml2/client_base.py", line 446, in create_authn_request
    msg = self._message(
          ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saml2/entity.py", line 588, in _message
    signed_req = self.sign(
                 ^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saml2/entity.py", line 524, in sign
    return signed_instance_factory(msg, self.sec, to_sign)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saml2/sigver.py", line 331, in signed_instance_factory
    signed_xml = seccont.sign_statement(signed_xml, node_name=node_name, node_id=nodeid)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saml2/sigver.py", line 1695, in sign_statement
    return self.crypto.sign_statement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/saml2/sigver.py", line 798, in sign_statement
    raise SignatureError(com_list) from e
saml2.sigver.SignatureError: ['/usr/bin/xmlsec1', '--sign', '--privkey-pem', '/app/backend/certificate/key_certificate.key', '--id-attr:ID', 'urn:oasis:names:tc:SAML:2.0:protocol:AuthnRequest', '--node-id', 'id-UKNHXCEIiZusmqSbT', '--output', '/tmp/tmp750au002.xml', '--lax-key-search', '/tmp/tmp9__60ipk.xml'] 

I would appreciate some help or hints about, how to fix it or if there is any workaround that we could use to solve the problem.

I am looking forward for any help.

Kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant