Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JHipster JWT authentication across browser tabs

I'm getting started with jHipster.. I have configured to use JWT for authentication.

When signed in using one tab and try to open secured page in other tab, I'm not authenticated in the new tab Is this the default behavior of JHipster? Is it possible to configure token sharing across multiple browser tabs?

I tested more and below is my observation. When using HTTP session based authentication and OAuth2 based JWT authentication, I'm authenticated across different tabs. But when I use JWT based authentication, when logged in one tab, I'm not authenticated in a new tab. I tested this using production configuration too.. It has the same behavior.

I'm not sure if this is the default behavior of JHipster.. but i feel the behavior is inconsistent between different authentication methods... One observation is OAuth2 uses browser localstorage and plain JWT uses sessionstorage.. When using session storage, the tokens are not visible between the tabs... This explains the behavior.

Is this the default behavior of JHipster?

like image 542
Swadeesh Avatar asked Jul 10 '17 08:07

Swadeesh


1 Answers

Try to click "Remember me" button. So, it will remember you accross tabs.

like image 120
Altay Hunoğlu Avatar answered Sep 28 '22 06:09

Altay Hunoğlu