0
votes

I have a web app developed using Create-react-app
I host it on IIS, the IIS only response to load the app, there is no server side logic on it (no Express or any other web server)
The app is using a RESTful API on the same IIS, it is out of my control (I cannot make change).

Now one of my client request to add SAML SSO to our app.

I would like to know:

  1. in normal situation, which one is the Service Provider? My IIS Web server? or the API service?
  2. For my case, I cannot implement SAML to API service, my web service only used to load my app without server side logic, how can I implement SAML?
  3. Could any one give me some React implement SAML SSO tutorial or article for reference?

Thanks for any help, any information or suggestion are welcome!

1
SAML is not often used / intended for SPA (single page applications). how do you authenticate and authorize the call to the APIs currently? - gusto2
I have a login page to enter id/pw, post them to API server Login endpoint to authenticate and get back a JWT token. After that we use that token in API calls for authentication. - Eric Cheng
I would suggest that you shift to OAuth, or better, OIDC. - Andrew K.

1 Answers

1
votes

in normal situation, which one is the Service Provider? My IIS Web server? or the API service?

I assume the client wants to authenticate the users using their internal IdP. So your application is the SP. But you will have to define different token service (details below).

With SPA (a single-page-applications) I see the problem, in SAML the user is redirected or posted away from the SAML request and SAML response.

I have a login page to enter id/pw, post them to API server Login endpoint to authenticate and get back a JWT token. After that we use that token in API calls for authentication

The API services are using a JWT token issued based on the provided username/password. I'd recommend to extend the token service (or use a different service) to issue a JWT token based on the provided SAML response - a token swap service. In many OAuth implementations it's called SAML grant type.

I cannot implement SAML to API service, my web service only used to load my app without server side logic, how can I implement SAML?

Usually after the authentication the user is redirected or posted to the SAML ACS endpoint URL, where the server can create sort of session (cookie, parameters, token, ..) and the user is redirected to a URL returned the web page with the session information.

If you are using an SPA, you could use a popup window or SAML with redirect (not with post), where the page could read the SAML response parameters (assertion, signature, ..) and use them in the token swap service mentioned above.

When processing the SAML response, try to use some mature, known, out-of-box libraries, it's a security service and not doing it properly may cause security weaknesses. But you need to do that on the server side, as at the end you need the JWT token consumed by the APIs.