sample-angular-oauth2-oidc-with-auth-guards icon indicating copy to clipboard operation
sample-angular-oauth2-oidc-with-auth-guards copied to clipboard

Application logs out too quickly in Firefox

Open MatthiasvB opened this issue 2 years ago • 1 comments

I have cloned the repository, npm installed the dependencies, and npm started the dev server.

Works.

I opened the app in Firefox v107.0

I then went to the Admin 2 component, which redirects to the login page. I logged in with my Google account.

I get redirected back to the application, and for a brief moment, I can see all those details about my credentials and the information contained in the token. Works.

A short time later, about 5 seconds after logging in, I seem to get logged out and the token info vanishes too quickly for me to make sense of it.

I navigate to Admin 2 again, now it does a more or less silent refresh - no need for any user interaction.

I see info, I get logged out.

I tried to change silentRefreshTimeout and timeoutFactor in auth.config.ts, but it's no use.

In Edge, it works, so I assume this is a Firefox bug. Do you know what causes it? Is it the same issue you describe for Safari? How do I avoid this issue in my own project?

MatthiasvB avatar Nov 25 '22 15:11 MatthiasvB

I don't actually know, but I do also see this behavior. I suspect it has to do with either third party cookies stuff or other stricter origin checks by Firefox. Those are for the benefit of us as browser users, but unfortunate to deal with as devs. If that's the case, then running your IDS on the same origin is one of the possible solutions.

Someone (e.g. you, yourself) would need to dive into this and investigate, let us know that the deal is here, before we can be sure.

jeroenheijmans avatar Nov 25 '22 15:11 jeroenheijmans