'How to use SAML based SSO in a React based SaaS apps
I am trying to implement SSO using SAML for our SaaS apps ( React + Typescript ) . However, the key issue here is that the SSO is only for selected customers , for which our application has to be protected using customers' IDP. Hence it is NOT possible for me to use the node libraries like passport / passport-saml as in --
passport.use(new SamlStrategy(
{
path: 'callback',
entryPoint: 'IDP endpoint',
issuer: 'passport-saml',
cert: 'cert', // cert must be provided
},
....
}
I have to programatically route the authentication to customers' IDP for selected customers.
My question is , for UI resources/pages, do we need to post SAML AuthnRequest OR should I simply route the login UI to customer's IDP endpoint as in --
window.location.replace(IDP_ENDPOINT)
In this way, I am able to redirect to SAML endpoint and able to receive the SAML assertion in my callback Url . However I am not able to pass on the relay state while redirecting the browser.
Any pointer for SSO integration using SAML v2 in typescript environment is highly appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
