samlify: Error on the server side : Cannot read property 'SAMLResponse' of undefined

Hey there ! I am trying to sort my onelogin sso authentification following this example : https://samlify.js.org/#/onelogin

I’m a bit confused by this bit :

router.get('/spinitsso-redirect', (req, res) => {
    const url = sp.createLoginRequest(idp, 'redirect');
    return res.redirect(url);
});

The “url” returned is actually an object ? I had to do url.context to get the url back

I am now trying to access myurl/sso/spinitsso-redirect but getting the following error : TypeError: Cannot read property 'SAMLResponse' of undefined

Any ideas why ? Am I missing something ?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Then I guess you need the body-parser middleware, (https://www.npmjs.com/package/body-parser) when you receive and parse the POST/ response from the onelogin side.