What to do when you have locked yourself out by invalid SSO configuration or read-only mode


(Erlend Sogge Heggen) #1

If you’ve locked yourself out of your Discourse instance with an invalid SSO configuration, append /u/admin-login to the end of your forum’s root URL:

https://forum.example.com/u/admin-login

This will take you to an admin login page:

You’ll be sent an email with a log-in link that circumvents SSO and read-only mode. Do note however that if you have 2FA enabled you’ll still have to enter your auth code.

Using the console

cd /var/discourse
./launcher enter app
rails c
> SiteSetting.enable_sso = false

to disable SSO

cd /var/discourse
./launcher enter app
rails c
> Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)

to disable read-only mode