SAML-Toolkits / python3-saml

MIT License
704 stars 309 forks source link

Urgent - demo_django | page redirecting back to django login page #394

Closed mdmuzakkir86 closed 5 months ago

mdmuzakkir86 commented 9 months ago

I am getting 302 response "GET /?sso HTTP/1.1" 302 0 on ubantu terminal and server getting terminated

When I click on login, its's redirecting to OneLogin login, I entered creds and try to login, page redirecting back to django login page with this url (http://localhost:8000/?acs) and server getting stop

please check the screenshots for more clarity. Please help me to solve this issue

image

advaced_settings.json

{
    "security": {
        "nameIdEncrypted": false,
        "authnRequestsSigned": false,
        "logoutRequestSigned": false,
        "logoutResponseSigned": false,
        "signMetadata": false,
        "wantMessagesSigned": false,
        "wantAssertionsSigned": false,
        "wantNameId" : true,
        "wantNameIdEncrypted": false,
        "wantAssertionsEncrypted": false,
        "allowSingleLabelDomains": false,
        "signatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
        "digestAlgorithm": "http://www.w3.org/2001/04/xmlenc#sha256",
        "rejectDeprecatedAlgorithm": true,
        "wantAttributeStatement": false
    },
    "contactPerson": {
        "technical": {
            "givenName": "technical_name",
            "emailAddress": "technical@example.com"
        },
        "support": {
            "givenName": "support_name",
            "emailAddress": "support@example.com"
        }
    },
    "organization": {
        "en-US": {
            "name": "sp_test",
            "displayname": "SP test",
            "url": "http://sp.example.com"
        }
    }
}

settings.json

{
    "strict": true,
    "debug": true,
    "sp": {
        "entityId": "http://localhost:8000/metadata/",
        "assertionConsumerService": {
            "url": "http://localhost:8000/?acs",
            "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
        },
        "singleLogoutService": {
            "url": "http://localhost:8000/?sls",
            "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
        },
        "NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
        "x509cert": "",
        "privateKey": ""
    },
    "idp": {
        "entityId": "https://app.onelogin.com/saml/metadata/70302f1c-1f9b-4151-b5c8-d996fdebxxxx",
        "singleSignOnService": {
            "url": "https://dsolab-dev.onelogin.com/trust/saml2/http-post/sso/70302f1c-1f9b-4151-b5c8-d996fdexxxxx",
            "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
        },
        "singleLogoutService": {
            "url": "https://dsolab-dev.onelogin.com/trust/saml2/http-redirect/slo/311xxxx",
            "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
        },
        "x509cert": "I have not mentioned cert to avoid security issues"
    }
}

Here are the Onelogin details image image image

pitbulk commented 9 months ago

When I click on login, its's redirecting to OneLogin login, I entered creds and try to login, page redirecting back to django login page with this url (http://localhost:8000/?acs) and server getting stop

You will need to add a debugger on the acs controller view and see what's going wrong there.