Thanks @braden. I solved the signing issue but I get this error:
2023-08-05 14:18:14,932 ERROR 19 [django.request] [user None] [ip 178.131.186.150] log.py:224 - Internal Server Error: /auth/complete/tpa-saml/
Traceback (most recent call last):
File "/openedx/edx-platform/common/djangoapps/third_party_auth/saml.py", line 92, in get_user_id
return super().get_user_id(details, response)
File "/openedx/venv/lib/python3.8/site-packages/social_core/backends/saml.py", line 304, in get_user_id
uid = idp.get_user_permanent_id(response['attributes'])
File "/openedx/venv/lib/python3.8/site-packages/social_core/backends/saml.py", line 45, in get_user_permanent_id
uid = attributes[self.conf.get('attr_user_permanent_id', OID_USERID)]
KeyError: 'urn:oid:0.9.2342.19200300.100.1.1'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/pyenv/versions/3.8.12/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/openedx/venv/lib/python3.8/site-packages/social_django/utils.py", line 46, in wrapper
return func(request, backend, *args, **kwargs)
File "/openedx/venv/lib/python3.8/site-packages/social_django/views.py", line 31, in complete
return do_complete(request.backend, _do_login, user=request.user,
File "/openedx/venv/lib/python3.8/site-packages/social_core/actions.py", line 45, in do_complete
user = backend.complete(user=user, *args, **kwargs)
File "/openedx/venv/lib/python3.8/site-packages/social_core/backends/base.py", line 40, in complete
return self.auth_complete(*args, **kwargs)
File "/openedx/venv/lib/python3.8/site-packages/social_core/backends/saml.py", line 332, in auth_complete
return self.strategy.authenticate(*args, **kwargs)
File "/openedx/venv/lib/python3.8/site-packages/social_django/strategy.py", line 105, in authenticate
return authenticate(*args, **kwargs)
File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/debug.py", line 42, in sensitive_variables_wrapper
return func(*func_args, **func_kwargs)
File "/openedx/venv/lib/python3.8/site-packages/django/contrib/auth/__init__.py", line 76, in authenticate
user = backend.authenticate(request, **credentials)
File "/openedx/venv/lib/python3.8/site-packages/social_core/backends/base.py", line 80, in authenticate
return self.pipeline(pipeline, *args, **kwargs)
File "/openedx/venv/lib/python3.8/site-packages/social_core/backends/base.py", line 83, in pipeline
out = self.run_pipeline(pipeline, pipeline_index, *args, **kwargs)
File "/openedx/venv/lib/python3.8/site-packages/social_core/backends/base.py", line 113, in run_pipeline
result = func(*args, **out) or {}
File "/openedx/venv/lib/python3.8/site-packages/social_core/pipeline/social_auth.py", line 9, in social_uid
return {'uid': backend.get_user_id(details, response)}
File "/openedx/edx-platform/common/djangoapps/third_party_auth/saml.py", line 97, in get_user_id
message=ex.message, # lint-amnesty, pylint: disable=no-member
AttributeError: 'KeyError' object has no attribute 'message'
I validated my saml response here and it said that the reponse is valid. Also I used this tool for extracting info sent in saml idp response which looks like this
I’ve tried changing the User ID Attribute
to both urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
and urn.oid:0.9.2342.19200300.100.1.1
in both idp settings and openedx saml idp configuration. When I set name id format to only urn.oid:0.9.2342.19200300.100.1.1
in my idp, I get an error at the start of login process, saying: ImproperlyConfigured: SP requested a name_id_format that is not supported in the IDP: urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
.
When I put only the unspecified one or even both of them in the idp settings, edx returns the error mentioned above. When I set User ID Attribute
to urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
in openedx saml idp configuration, the only difference it makes is changing part of the error message from urn.oid:0.9.2342.19200300.100.1.1
to urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
.