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

Logout isn't working properly #153

Open
dignitech-rakesh opened this issue Aug 30, 2023 · 0 comments
Open

Logout isn't working properly #153

dignitech-rakesh opened this issue Aug 30, 2023 · 0 comments

Comments

@dignitech-rakesh
Copy link

I am trying to implement SAML in Django and I have two servers example.com and idp.example.com. On the IDP server, I am using djangosaml2idp. I have been able to implement the login functionality successfully, but the logout is failing on the IDP server.

Checking logs on idp.example.com reveals the following issue:
ServiceError: 'str' object has no attribute 'destination' {'status': 400} Traceback (most recent call last): File "/home/user/env/lib/python3.9/site-packages/djangosaml2idp/views.py", line 394, in get hinfo = idp_server.apply_binding(binding, resp.__str__(), resp.destination, relay_state, response=True) AttributeError: 'str' object has no attribute 'destination'
The logout response is as follows:

<?xml version="1.0"?> <ns0:LogoutResponse xmlns:ns0="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ns1="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:ns2="http://www.w3.org/2000/09/xmldsig#" ID="id-bqYKCp1IDnaWAxGW3" InResponseTo="id-rjBCfmJo86fZ9sKid" Version="2.0" IssueInstant="2023-08-30T07:58:17Z" Destination="https://example.com/saml2/ls/post/"><ns1:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://idp.example.com/idp/metadata/</ns1:Issuer><ns2:Signature Id="Signature1"><ns2:SignedInfo><ns2:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ns2:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ns2:Reference URI="#id-bqYKCp1IDnaWAxGW3"><ns2:Transforms><ns2:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ns2:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></ns2:Transforms><ns2:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ns2:DigestValue>9EufdzSXgKly0XjOcl8l2DYzUhk=</ns2:DigestValue></ns2:Reference></ns2:SignedInfo><ns2:SignatureValue>kTiqFydF7hL8ZlgC9iHQ3K7cU7T74XfORC0Y1AJqjwCg1MfgtDbTLIn/d/Zn8RnU s0jmPrC588lcJeB/vzhuzWsJrQjyhPyb9Z7Xqjkx8wBtM39vmL0vIC92wS3/u4+n mxOk6V+DnyB75cYL60yApHyiXs5RqW24UDUsuTGksT03LCKRNrraJGwG7jNtNvZE onkJdEyhIIxsDlyqfXYiVgjP77E0rIhVEZfwQ4C3yDEdBNVBHr9RkHlvm0HmqRxF UrJNQww6V+b69x6vB+wlC/nIjh7i6QDMtO5tsTlu+JSzvEn7xLc67qPvZxdYScek fcpY8PCs7WCTrXbTF9XzTg==</ns2:SignatureValue><ns2:KeyInfo><ns2:X509Data><ns2:X509Certificate>MIIDGzCCAgOgAwIBAgIUd0aRekN/sTmINbOXE7IragHy5UwwDQYJKoZIhvcNAQELBQAwHTEbMBkGA1UEAwwSaWRwLnJlZ2V4cGxvcmUuY29tMB4XDTIzMDQyMDEwNTkxN1oXDTMzMDQxNzEwNTkxN1owHTEbMBkGA1UEAwwSaWRwLnJlZ2V4cGxvcmUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvzdfnFfUhoTmuRpqBLabIBiWUjRZZ2OwxfJlRki1eyOjmi/lySbCY3/PSQG+KZ47mpxiz2+gTkdj6hTilRGvvCpXsJuHvNWE4w2yS6n8Weps40Rpb9uEihfljhCL2h/ImRakXohPd8x/0FXbozZZLLwudyhEpBFcRjnHoFgxmnVFQyox2+M6tpBOOg6sRTVpcX6eVpfxKPXg+Anp5xWQtyXI0+gGRqB6bTh/BZVLIgCNj/KpoU4f7AjcFVALe6GfakXPlAjPvN1W0GJhIwfDLGtYgNA5cAW5GebBIlDOvZjRFet9+sJ6XiqR5RZnZQHe/NEpS5TrQXLhM3y60x6lrQIDAQABo1MwUTAdBgNVHQ4EFgQUXhIrqxid+CLwzXs6xkjNtAob3mQwHwYDVR0jBBgwFoAUXhIrqxid+CLwzXs6xkjNtAob3mQwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAfrCNy+9OHbGGWKDM6KIzsw+q+rUlq55mKENR/E57UiJn+RauNx2rneXKSVcDuNVD+Gk5nXc3wqzbmuCKxvjF5Sdb/E4uwhI1ohw0tieAqQu5k1juMuCeGVeAMClFtoc681b3nUsKS5LyUJBtO8rxLEMC6MT70JB3xxqVgzCe1Q5VhwUfPiyEAXsH4WfjolPCKogZF1dE/dRA2o3Iw4J/yb+RiMf6cukELogibQfHom0No7YzH0xsSsnFAPaukySJdpuW6DUwRVDTSPaYPDFDadqY2FrlzWPvSy6p2KkcclPWmsj/kjAfXmI4MrXJ7t5WUzQUFw2mfab/rKBSn8i4uA==</ns2:X509Certificate></ns2:X509Data></ns2:KeyInfo></ns2:Signature><ns0:Status><ns0:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></ns0:Status></ns0:LogoutResponse>

Looks like it's not able to parse the resp object.

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