vendure-ecommerce / vendure

The commerce platform with customization in its DNA.
https://www.vendure.io
Other
5.69k stars 1.01k forks source link

Keycloak authentication - cannot mantain session #2580

Open margamorais opened 10 months ago

margamorais commented 10 months ago

I was testing sso authentication for admins using the same code as in the keycloak test plugin.

On the first login it's creating the user. And after that I can retrieve the user, however when redirecting to '/admin' It's redirecting back to the login page because it's not mantaining the session.

What could be missing?

margamorais commented 9 months ago

Hi there, Is there any more information we can provide to help assess this issue? @michaelbromley

michaelbromley commented 9 months ago

Hi, I have a vague idea of running into this in the past from someone else. I remember looking into it briefly and concluding that we need to make some change to properly support this in the way the Admin UI bootstraps. I cannot remember all the details right now.

I'm adding this to the backlog and will investigate further at the next opportunity.

If you want to do so yourself in the mean time and share any findings or even open a PR, that will speed things up.

michaelbromley commented 9 months ago

Closing in favour of https://github.com/vendure-ecommerce/vendure/issues/2363

michaelbromley commented 9 months ago

Actually this is a distinct issue, and I think it is due to the fact that cookies/localStorage are scoped to a specific domain, so when you have the login page on a different domain, then redirect to the Admin UI app, the session token is not transferred.