-
Notifications
You must be signed in to change notification settings - Fork 45
Account impersonation & Apollo... #44
Comments
We use the localstorage token: https://github.com/apollostack/meteor-integration/blob/master/main-client.js#L30 so maybe taking https://github.com/gwendall/meteor-impersonate/blob/master/client/lib.js#L9 and calling |
It'd be nice to get @gwendall involved in this; though I'm not sure how active he is these days. |
@lorensr I tried modifying the code to store the login token, but I can't get it working because in @gwendall's client code it seems to never have the token for the impersonated client, only for the "original" user. It seems to use |
Could modify the method to always return the token of the target user On Wednesday, November 2, 2016, Simon Mansfield [email protected]
|
Tried that, but weird stuff™ happens. (I am briefly logged in as the impersonated user and then immediately kicked out.) I wish I understood the impersonate code better, as I think it could use a bloody good tidy up and NPM'ifying, but I just don't get it well enough to try. Shame it's not a core Meteor bit of functionality really, as I'm sure it's useful for a lot of people. (Just look at the most recent reference to this issue!) |
I'll just do a quick plug of our package here that solved all of these issue: https://github.com/Swydo/ddp-apollo This allows you to use DDP for data transport. So it uses all the Meteor authentication that you're used to. It's probably not going to be the default implementation, see discussion here, but it helped us to use Apollo with a solid and backward compatible authentication mechanism. You can leave any questions in that repo. |
@Siyfion did you ever have any luck implementing this? |
@etyp No... I did it all a slightly different way. I ended up tweaking the server authentication logic to allow a login if the password matched a randomly generated short-lifetime hash. This hash was then provided to the administrators and they can access all the accounts in this manner. |
So I've been using a form of account impersonation for my admin team to manage other people's accounts and/or data without knowing their passwords, etc.
Loosely based on https://dweldon.silvrback.com/impersonating-a-user I use, @gwendall's https://github.com/gwendall/meteor-impersonate
Would it be possible to somehow integrate these two packages, so that the impersonation isn't "lost" in the Apollo data endpoints.
Perhaps @lorensr will have some words of wisdom!? 👍
The text was updated successfully, but these errors were encountered: