I have two web applications (prototype) hosted on two sub-domains, example:
1) A CMS (done in PHP) at cms.mydomain.com.
2) A SPA - Singe page web application (done in JavaScript) at spa.mydomain.com.
My User case:
User can access CMS app and authenticate using Username and Password.
After authentication is successfully completed a web page with some items is presented on CMS app.
User can select an item and than open on a new window with SPA application.
At the moment, after authentication is completed in CMS app a Bearer Token is created, we are passing the TOKEN to the SPA app as query string in order to authenticate the User.
SPA app JavaScript retrieves the query string and other additional parameters and execute API call in order to function.
Notes:
I am aware that TOKEN in query strings could be unsecured because:
URLs with their query strings parameters are saved in web server log, and access to them could compromise security.
Third party application like Google Analytic could store in their report such URLs and query string.
I would like to know your opinion on:
Thanks for your time.
You could perhaps create a one-time access token to the SPA rather than sending the original bearer token as the query string.
This token could then be sent to the API, decoded and used to create the real auth token, but would have the advantage of only being valid once. Now you no longer need to worry about server logs, GA, etc. I suppose it's a form of redirection to alleviate those concerns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With