tngan / samlify

Node.js library for SAML SSO
https://samlify.js.org
MIT License
611 stars 217 forks source link

Can't Parse idp.parseLoginRequest #545

Open myevit opened 4 months ago

myevit commented 4 months ago

I am trying to parse SP SAMLrequest

app.post('/saml2/login', async (req, res) => {
    try {
        // console.log(req.body.SAMLRequest)
        const {requestData} = await idp.parseLoginRequest(sp, 'post', req );
        console.log(requestData)
        const user = { email: 'user@gmail.com' };
        const { context, entityEndpoint } = await idp.createLoginResponse(sp, null, saml.Constants.wording.binding.post, user, createTemplateCallback(idp, sp, user.email));

        res.status(200).send({ samlResponse: context, entityEndpoint })
    } catch (e) {
        console.log(e)
        res.status(500).send()
    }
})

but requestData contain no data. I can't find no documentation on how to create SAMLresponce on SAMLrequest.

anyone can help?

alifarooq-zk commented 1 month ago

@tngan any update on this. i'm facing the same issue