Supposed I have a web application that needs to authenticate a user. Instead of doing it on its own, it redirects the user to a dedicated authentication service.
There the user logs in, and a JSON web token (JWT) is created containing the claims for the user.
Now - how do I send back the JWT to the client app?
Basically, I could do a redirect again, but then I need to put the JWT into the url, and I want to avoid this (I guess it's not the best idea to have the token in the url visible for everyone with access to the browser history).
What else could / should I do?
I could imagine doing a POST
back to the original server and sending the JWT inside the body. Then it would be hidden, and the original server could access the token anyway.
Any other ideas or suggestions?