Skip to content
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

feature request: SDKs supporting impersonation #6914

Open
marwie opened this issue Dec 29, 2024 · 4 comments
Open

feature request: SDKs supporting impersonation #6914

marwie opened this issue Dec 29, 2024 · 4 comments
Labels
pending-verification Something is still under investigation

Comments

@marwie
Copy link

marwie commented Dec 29, 2024

What problem did you meet?

I'm trying to implement user impersonation using the logto sveltekit SDK. Unfortunately the SDK does not support impersonation officially (discord)

When trying to debug it's important to be able to view the whole app from a user's perspective, hence the ability to impersonate a user is great. But without support in the SDK it seems to be I'm forced to put a lot of hacks or workarounds in place which is potentially error prone. (If there's a recommended way to deal with this limitation I'd appreciate any guidance)

Describe what you'd like Logto to have

I'm using the logtoclient throughout my app and would like to be able to override the client's access token with my subject/access token to start impersonation and viewing the app from the user's perspective without having to worry to mix access tokens anywhere.

Copy link

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Jan 13, 2025
@marwie
Copy link
Author

marwie commented Jan 13, 2025

Bump

@github-actions github-actions bot removed the stale label Jan 14, 2025
@simeng-li simeng-li added the feature-request Something cool or not cool label Jan 20, 2025
@simeng-li
Copy link
Contributor

Thanks for your feedback!
However, mixing user impersonation tokens and user-requested tokens is highly not recommended due to security and token management concerns. Requesting and managing impersonation tokens on the client side would put your app at high-security risk, as it exposes sensitive administrative actions to the front end.

Currently, our SDK is designed for client-side use only, and user impersonation is an admin feature that can only be requested through the Logto Management API, to be managed securely on your backend service. Please refer to this documentation for more details on how to implement user impersonation securely. Let us know if you have any further questions!

@simeng-li simeng-li added pending-verification Something is still under investigation and removed feature-request Something cool or not cool labels Jan 20, 2025
@marwie
Copy link
Author

marwie commented Jan 20, 2025

Hello @simeng-li

I understand the concern, however I'm currently using the sveltekit SDK on the server only and don't request tokens client-side.

It would help already if I could override the access token in the SDK - do you know if that's possible somehow at the moment or if that's something you could potentially add to the SDK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-verification Something is still under investigation
Development

No branches or pull requests

2 participants