spicypixel
spicypixel2mo ago

Frontend implementation of impersonation using @zitadel/react

Firstly, raised this as an issue so we get a log of this: https://github.com/zitadel/zitadel-react/issues/31 Just wanted to know how to use the token exchange functionality to then reinitiate a frontend session using the impersonated token the backend has issued. Thanks
GitHub
How to use an impersonated token from token exchange? · Issue #31 ...
Hey, I've implemented a backend handler to take the access token from the frontend and a target userid, and if the roles/permissions are all good, permits them to exchange their token for the t...
2 Replies
fcoppede
fcoppede7d ago
hey @spicypixel thanks for reaching out, can you please share some additional details about your use case? How does your login flow should work?
spicypixel
spicypixelOP6d ago
I’ll get some notes up at work tomorrow Okay so this isn't really login flow per se but I'll try to summarise it best I can: - Load application in browser - Login as your staff/admin account - You get additional privileges in a special staff only admin panel of the frontend that can allow you to impersonate a user in another org to do support help on behalf of a user - You press impersonate and the backend does a token exchange safely and returns the jwt to the frontend in the http request - This is the bit I'm confused about, how do I substitute this response into the local storage and reload the application so an impersonated session can begin

Did you find this page helpful?