-
-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impersonate / Switch User #1196
Comments
I was not able to make the impersonation work either, even if I followed the documentation to the letter. |
Hi guys, Apologies for the super late reply, my OSS bandwidth has been very limited lately.
I cannot give a guarantee for this to work as I didn't look at it yet, nor I can provide a timeframe into which this would be fixed and properly documented yet. What I can tell is that this would be a worthwhile bugfix and I'll look into it as soon as I can, so please don't close. Any help investigating or fixing it is more than welcome. Cheers! |
Hi, I use the switch user feature everyday and works perfectly fine even with cookies (I use cookies to store my JWT) First, authenticate the main user as usual. The key thing is that with javascript you have to manage the session and cookies yourself. While with a standard Symfony application, the framework does the job for you (in a different way). Maybe the doc needs to be clarified to remember that this things must be managed on client side. Hope this helps. |
There is a problem for sure with the way the bundle logs the user in if the cookie extractor is enabled, somehow, it overrides the entire session. If I remove the cookie that contains the token, and I try to switch to another user, it works just fine. For now I had to write a custom controller to do impersonation for my use case, but from what I have seen so far, this feature does not work properly currently. |
Hi,
I'm trying to perform impersonation / switch user over JWT with LexikJWTAuthenticationBundle and it's not clear if the bundle supports it natively or not.
The official bundle documentation on Symfony website seems to indicate the bundle supports it, but there is no explanation about how to process except a link to the Symfony switch user documentation.
I found several issues about this, sometimes very old and outdated, but none comes with an actual working solution neither with a clear statement about switch user support of LexikJWTAuthenticationBundle.
My use case is quite the same as session/cookie based authentication. I'm authenticated as admin (I have a valid JWT) and I want to use it to get another JWT that authenticate me as the impersonated user and allowing me to get the previous user from the security token. Is that possible ? Or do I have to code my own stuff to handle that ? Does JWT can even do that ?
Thanks, any clues will be greatly appreciated.
The text was updated successfully, but these errors were encountered: