For those who may face this problem in the future: Windows OS (still don't know certainly if the problem is caused due an OS particularity, I couldn't test it in other environments), pysaml2, and django-saml2-auth don't handle self signed certificates very well. I could solve the problem by just forking pysaml2/django-saml2-auth and passing downloaded cert-files from IdP (.pem) manually.
The error the application throws is:
ERROR:saml2.sigver:check_sig: 
ERROR:saml2.response:correctly_signed_response: Failed to verify signature
ERROR:saml2.entity:Signature Error: Failed to verify signature
ERROR:saml2.client_base:XML parse error: Failed to verify signature
And it seems to be a Windows problem. Does anyone know how should I implement this? The command used to verify the XML is:
C:\Windows\xmlsec1.exe --verify --enabled-reference-uris empty,same-doc --enabled-key-data raw-x509-cert --pubkey-cert-pem C:\Users\me\AppData\Local\Temp\tmp8wssc6_f.pem --id-attr:ID urn:oasis:names:tc:SAML:2.0:assertion:Assertion --node-id _579304c7-f1c4-5918-83ee-4b33c5df1e00 --output C:\Users\me\AppData\Local\Temp\tmpw9lbnowc.xml C:\Users\me\AppData\Local\Temp\tmpcg9l7jik.xml
And it returns b"".
Thanks in advance.
Problems while implementing SSO using Django SAML2 Auth and AzureAD