Users are losing Admin role due to SSO

AI-generated summary

Users on the self-hosted forum at https://discuss.gravit.io/ are experiencing loss of Admin roles, particularly affecting two out of three admins. christian.krammer reports that roles are manually reassigned but vanish again over time. fefrei suggests checking Admin → Logs → Staff Actions, but logs only show manual grants without indicating removals. Falco identifies the root cause: since the forum uses SSO, if the SSO payload includes admin=false, the Admin role is revoked on next login. christian.krammer asks where to change this, and Falco advises modifying the SSO application at https://cloud.gravit.io/sso to stop sending the admin attribute if admin management should be handled solely within Discourse. jomaxro recommends enabling verbose SSO logging in settings and inspecting logs at https://discuss.gravit.io/logs to confirm whether admin=false is being sent — a known issue affecting multiple sites. The solution hinges on adjusting the SSO provider’s behavior to preserve admin status or managing roles exclusively inside Discourse.

We have the problem in our self-hosted forum at https://discuss.gravit.io/ that I and a colleague are always losing the Admin role. Somebody assigns it to me, I assign it to a colleague, and after a while, both of us aren’t Admins anymore.

Anything we can do? Any information I can give you?

Are there any other admins in your instance? Do you see anything related in Admin → Logs → Staff Actions?

Yes, we have three Admins in total. One of them seems to keep his Admin status, but the remaining two seem to lose it regularely.

Had a look at the logs, but nothing points to admins, just the "grant admin"s, where we assigned the Admin role amongst each other. I can share the log with you if you like.

You use SSO, so if the SSO payload has admin=false admin will be removed on next login.

That sounds reasonable. Where can I change that?

If you want to manage admin powers in Discourse only, change the application that lives on https://cloud.gravit.io/sso to stop sending the admin attribute.

To check if admin=false is being sent in the SSO payload, enable verbose SSO logging via settings and check your logs at https://discuss.gravit.io/logs. It’s highly likely this is the issue, we’ve seen it on multiple sites in the past.