# Can't make user admin, reverts when logging in

**URL:** https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186
**Category:** Support
**Created:** [15.Март.2017 16:03:58 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186 "2017-03-15T16:03:58Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Denis\_Heraud](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denis_heraud/32/119623_2.png) [@Denis\_Heraud](https://meta.discourse.org/u/Denis_Heraud)
#### Post date: [15.Март.2017 16:03:58 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/1 "2017-03-15T16:03:58Z")

</div>

Hello everyone!

I’m trying to make a user an admin, I have tried going to admin/users/ and clicking on the Grant Admin and Grant Moderator buttons. If I go back to my user list, I can see that the user was granted those rights. However, as soon as the user logs in, the access is automatically revoked and reverts back to a regular user. I have also tried logging in via SSH and granting admin access to the user manually, butI get the same result where the user logs in and is reverted back to regular user rights…

What is going on here?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [15.Март.2017 17:21:40 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/2 "2017-03-15T17:21:40Z")

</div>

Are you using SSO? Or just the standard Discourse login system?

---

<div class="post-metadata">

### Author: ![Denis\_Heraud](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denis_heraud/32/119623_2.png) [@Denis\_Heraud](https://meta.discourse.org/u/Denis_Heraud)
#### Post date: [15.Март.2017 17:31:03 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/3 "2017-03-15T17:31:03Z")

</div>

We are using SSO, yes.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [15.Март.2017 17:46:22 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/4 "2017-03-15T17:46:22Z")

</div>

Enable verbose SSO logs in settings. I believe that your SSO payload is sending `admin: false` and revoking the rights of the user.

---

<div class="post-metadata">

### Author: ![Denis\_Heraud](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denis_heraud/32/119623_2.png) [@Denis\_Heraud](https://meta.discourse.org/u/Denis_Heraud)
#### Post date: [15.Март.2017 17:54:46 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/5 "2017-03-15T17:54:46Z")

</div>

Thanks Rafael, I’m checking the logs now. How would I fix this issue assuming that that is indeed what is happening?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [15.Март.2017 17:57:50 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/6 "2017-03-15T17:57:50Z")

</div>

> [@Denis\_Heraud](#):
>
> How would I fix this issue assuming that that is indeed what is happening?

Like Jeff said:

> [@Add link to external SSO profile to profile page](https://meta.discourse.org/t/add-link-to-external-sso-profile-to-profile-page/59027/2):
>
> Being a parent (authentication site) entails so many responsibilities, Jay!

You will need to add `admin: true` for this user SSO payload.

---

<div class="post-metadata">

### Author: ![Denis\_Heraud](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denis_heraud/32/119623_2.png) [@Denis\_Heraud](https://meta.discourse.org/u/Denis_Heraud)
#### Post date: [15.Март.2017 18:35:34 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/7 "2017-03-15T18:35:34Z")

</div>

Haha, yes I realize that, I’m just not sure how to go about it. 🙂 And you were right, the SSO log shows:

admin: false  
moderator: false

So the question is, how would I pass on a parameter to a specific user’s SSO payload? I have never done that before.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [16.Март.2017 23:16:41 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/9 "2017-03-16T23:16:41Z")

</div>

> [@Denis\_Heraud](#):
>
> So the question is, how would I pass on a parameter to a specific user’s SSO payload? I have never done that before.

You already do that!

If user A comes in, you respond with `usera@mail.com` for email and when user B comes you respond with `userb@othermail.com`. Your SSO payload is already diferent for each user.

Something that is probably easier, is dropping both `moderator` and `admin` from the payload altogether and manage this only trough Discourse. I believe that it will work, too.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [15.Май.2019 11:09:20 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/10 "2019-05-15T11:09:20Z")

</div>



---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [15.Май.2019 11:11:24 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/11 "2019-05-15T11:11:24Z")

</div>

Did you figure it out @Denis_Heraud?

---

<div class="post-metadata">

### Author: ![Denis\_Heraud](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denis_heraud/32/119623_2.png) [@Denis\_Heraud](https://meta.discourse.org/u/Denis_Heraud)
#### Post date: [30.Май.2019 20:55:09 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/12 "2019-05-30T20:55:09Z")

</div>

@zogstrip Not yet but we may be migrating our database soon so I was waiting for that to happen before I take a stab at it.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [23.Октябрь.2022 15:27:57 UTC](https://meta.discourse.org/t/cant-make-user-admin-reverts-when-logging-in/59186/13 "2022-10-23T15:27:57Z")

</div>


