I'm planning a new application. Consider the following scenario:
I have a SAML IDP to log in users, but the IDP is not able to provide the JWT-tokens directly.
So what I want to do is the following:
start auth start SAML
+----------+ +------------> +---------+ +-----------> +----------+
| frontend | | backend | | SAML IDP |
+----------+ <------------+ +---------+ <-----------+ +----------+
JWT token SAML rspoonse
In this scenario my backend will receive the user details from the IDP and create a JWT token for the frontend. After the SAML authentication is done, a redirect will take place to the front end.
What is the best way to get the JWT token from the backend to the frontend?
I was thinking about storing it in a PHP session, and then the frontend would be able to perform an API call to get the JWT token (after which the token is removed from the session).
Are there any better ways to solve this?