Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Admin API to return an access token for any user of the server #6054

Closed
rxl881 opened this issue Sep 18, 2019 · 8 comments · Fixed by #8617
Closed

Admin API to return an access token for any user of the server #6054

rxl881 opened this issue Sep 18, 2019 · 8 comments · Fixed by #8617
Assignees
Labels
A-Admin-API z-feature (Deprecated Label)

Comments

@rxl881
Copy link

rxl881 commented Sep 18, 2019

Description:

It would be useful for the server administrator to be able to grab an access token on behalf of any user of their server. As discussed with @ara4n it would be good to extend the 'whois' admin API to offer this functionality

This could be useful for admins of the server to perform actions on behalf of another user (e.g. a dedicated 'abuse' user or bots etc.) and could also be useful for (benign) account puppeting, e.g. provisioning of integrations etc.

@t3chguy
Copy link
Member

t3chguy commented Sep 18, 2019

How should this play with devices, if an Admin "sudo's" into your account should it be a new device (which the user then should or should not be able to see in their devices list), should it just use a random device id?

@rxl881
Copy link
Author

rxl881 commented Sep 19, 2019

Yeah, would definitely need to be a new device ID (in order to protect e2e messages, unless the user explicitly verified the device). Ideally we should show in some way that the device ID relates to an admin (in order to provide some visibility of activity to the user, and what the device relates to, otherwise I can see people being very scared and confused at random device IDs popping up). So, maybe a random device ID with a "system_admin_" prefix, or something?

@neilisfragile
Copy link
Contributor

Would probably make more sense to issue a new access token entirely to avoid situations where a user's set up is inadvertently modified by the puppeting actions.

@rxl881 rxl881 added the z-feature (Deprecated Label) label Nov 27, 2019
@neilisfragile neilisfragile removed their assignment Oct 8, 2020
@clokep clokep changed the title Admin API should be able to return an access token for any user of the server Admin API to return an access token for any user of the server Oct 15, 2020
@clokep
Copy link
Member

clokep commented Oct 15, 2020

To reiterate from the above conversation, it sounds like we want to:

  1. Allow an admin to create a new device + access token for a user.
  2. Give that new device a particular display name (or a prefix) which makes it obvious that it is an admin token.

We probably also need a way for the admin to delete the token once done with it. Maybe this can re-use the delete device API.

@richvdh
Copy link
Member

richvdh commented Oct 15, 2020

@rxl881 to be clear, this will result in a new entry in Element's "Where you’re logged in" list. Is that acceptable?

@richvdh
Copy link
Member

richvdh commented Oct 15, 2020

We probably also need a way for the admin to delete the token once done with it. Maybe this can re-use the delete device API.

could just call /logout?

@clokep
Copy link
Member

clokep commented Oct 16, 2020

We probably also need a way for the admin to delete the token once done with it. Maybe this can re-use the delete device API.

could just call /logout?

That would work too. I mostly wanted to mention it so that we remember to document what you should do afterward to remove the token.

@erikjohnston
Copy link
Member

We may want to avoid creating a real device entirely, and just have a new access token that isn't related to a device. This has the advantage that it won't appear in your "Where you’re logged in" list, and won't cause any raised eyebrows from other users who see new unverified devices for the user.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Admin-API z-feature (Deprecated Label)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants