# Impersonating a user

**URL:** https://meta.discourse.org/t/impersonating-a-user/80862
**Category:** Feature
**Tags:** impersonate
**Created:** [February 18, 2018, 4:29am UTC](https://meta.discourse.org/t/impersonating-a-user/80862 "2018-02-18T04:29:11Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Biscuit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/biscuit/32/94482_2.png) [@Biscuit](https://meta.discourse.org/u/Biscuit)
#### Post date: [February 18, 2018, 4:29am UTC](https://meta.discourse.org/t/impersonating-a-user/80862/1 "2018-02-18T04:29:11Z")

</div>

I clicked impersonate a user, as they requested assistance and I wanted to see what access they had. I also wanted to understand how impersonate a user worked and what it’s used for.

I expected to simply see the same screen options that user would see, but was surprised when the screen displayed a draft of a post they were writing. It was an innocent post, but I didn’t feel comfortable seeing this work in progress & tried to exit immediately to respect their privacy. But I didn’t know how! I closed the browser, but when I returned to the site, it opened as the impersonated user again. I ended up logging out as that user, without knowing if I was also logging out the real user.

The lack of “EXIT” button during impersonation was discussed in this thread in 2014:  
[https://meta.discourse.org/t/impersonating-user-and-then-returning-to-admin/19382](https://meta.discourse.org/t/impersonating-user-and-then-returning-to-admin/19382)

**Feature suggestions:**

1. Display a confirmation message when someone clicks impersonate providing an indication of what’s involved, as it’s a serious action to take.

2. Add an obvious Exit or Stop Impersonating button.

3. If you don’t want to do #2 above, consider displaying a banner at the top saying something like:  
_“Currently impersonating User XXXXX - (take this action) to stop impersonating”_  
There’s currently no UI guidance about how to exit impersonation.

---

<div class="post-metadata">

### Author: ![notriddle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/notriddle/32/133055_2.png) [@notriddle](https://meta.discourse.org/u/notriddle)
#### Post date: [February 18, 2018, 4:31am UTC](https://meta.discourse.org/t/impersonating-a-user/80862/2 "2018-02-18T04:31:33Z")

</div>

Impersonation is supposed to allow you to check for things like broken CSS; the act of adding a message somewhere would change that.

---

<div class="post-metadata">

### Author: ![Biscuit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/biscuit/32/94482_2.png) [@Biscuit](https://meta.discourse.org/u/Biscuit)
#### Post date: [February 18, 2018, 4:35am UTC](https://meta.discourse.org/t/impersonating-a-user/80862/3 "2018-02-18T04:35:08Z")

</div>

Good point. Perhaps an alternative is to explain how to exit _before_ impersonation commences?

However it’s done, some form of UI guidance is required.

---

<div class="post-metadata">

### Author: ![dalerka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dalerka/32/120265_2.png) [@dalerka](https://meta.discourse.org/u/dalerka)
#### Post date: [February 18, 2018, 5:38am UTC](https://meta.discourse.org/t/impersonating-a-user/80862/4 "2018-02-18T05:38:18Z")

</div>

On a related note: it would be great if the act of impersonation would be covered by audit log. Is it logged somewhere? How can I see if someone has impersonated my account?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 18, 2018, 5:49am UTC](https://meta.discourse.org/t/impersonating-a-user/80862/5 "2018-02-18T05:49:49Z")

</div>

Yes, Admin, logs, as usual.

---

<div class="post-metadata">

### Author: ![Biscuit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/biscuit/32/94482_2.png) [@Biscuit](https://meta.discourse.org/u/Biscuit)
#### Post date: [February 18, 2018, 6:10am UTC](https://meta.discourse.org/t/impersonating-a-user/80862/6 "2018-02-18T06:10:46Z")

</div>

Confirmed - it’s listed in the logs.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [February 18, 2018, 6:15am UTC](https://meta.discourse.org/t/impersonating-a-user/80862/7 "2018-02-18T06:15:24Z")

</div>

It would probably be workable to have the button instead pop up a short explanatory dialog with [OK, color: danger] [Cancel] buttons. Could be entirely client-side.

> Impersonating blah blah acts as if you are logged in as that user. It can be useful when a member is experiencing odd behavior or you need to check their permissions.  
> To exit, use the “Log Out” button in the user menu.
