Open MySecondLanguage opened 2 years ago
Do you know which binding is being used? If you are using the HTTP-REDIRECT binding, the signature must be in the Authn request itself as the pysaml2 library doesn't yet support passing the signature via a URL query parameter. See this pull request.
If you are using the HTTP-POST binding, double check there is a signature in the Authn request.
How to use HTTP-POST
binding? I am using this djangosaml2idp
example source code?
How can use HTTP-POST
binding, as the request handle djangosaml2idp
this /idp/login/process/
?
Can you please have a look at my settings? i have already added above?
Hi, Can anyone help me to fix this?
It appears to be supported now, in https://github.com/IdentityPython/pysaml2/commit/718cf98a3baba4642ca9321e05115157c0d387dd
I am now testing this diff:
# diff -c /usr/local/lib/python3.9/dist-packages/djangosaml2idp/views.py.orig /usr/local/lib/python3.9/dist-packages/djangosaml2idp/views.py *** /usr/local/lib/python3.9/dist-packages/djangosaml2idp/views.py.orig 2022-01-18 15:08:14.414687736 +0100 --- /usr/local/lib/python3.9/dist-packages/djangosaml2idp/views.py 2022-01-18 16:01:56.845308818 +0100 *************** *** 56,61 **** --- 56,66 ---- request.session['Binding'] = binding request.session['SAMLRequest'] = saml_request request.session['RelayState'] = passed_data.get('RelayState', '') + if binding == BINDING_HTTP_REDIRECT: + if 'SigAlg' in passed_data: + request.session['SigAlg'] = passed_data.get('SigAlg') + if 'Signature' in passed_data: + request.session['Signature'] = passed_data.get('Signature') @never_cache *************** *** 233,239 **** idp_server = IDP.load() # Parse incoming request ! req_info = idp_server.parse_authn_request(request.session['SAMLRequest'], binding) # check SAML request signature try: --- 238,247 ---- idp_server = IDP.load() # Parse incoming request ! if binding == BINDING_HTTP_REDIRECT: ! req_info = idp_server.parse_authn_request(request.session['SAMLRequest'], binding, relay_state=request.session.get('RelayState', None), sigalg=request.session.get('SigAlg', None), signature=request.session.get('Signature', None)) ! else: ! req_info = idp_server.parse_authn_request(request.session['SAMLRequest'], binding) # check SAML request signature try:
In my case to get the example working I had to set:
'sign_response': False,
'sign_assertion': False,
'want_authn_requests_signed': False,
to sp.settings.py and idp.settings.py
I am implementing
SSO
withSAML2
but i am going through trouble. I am using these lib: https://github.com/OTA-Insight/djangosaml2idphttps://github.com/IdentityPython/djangosaml2
The
SP
is working well, there issue with theidp
This is the error i am getting:
and this is my url pattern
and this is my
settings.py
fileEveryting is working well but when it redirect to
/idp/login/process/
url, then it fires the error. Can anyone help me to solve this issue?