External SSO activated, can't revert it :-(

AI-generated summary

External SSO activated, can’t revert it :frowning:

jhf2442 accidentally activated external SSO for their Discourse site while trying to set it up as an SSO provider for Mediawiki. They’ve tried various workarounds, including setting SiteSetting.enable_sso=false through the ruby console and using the admin login backdoor (/users/admin-login), but none have been successful.

Stephen suggested disabling SSO from the rails console or using the admin login path, but jhf2442 had already tried these methods. jhf2442 corrected a typo in their previous attempt, and jhf2442 also tried setting SiteSetting.enable_local_logins = true, but still couldn’t regain access.

Stephen provided an alternative admin login URL (https://<yoursiteurl>/u/admin-login/), but jhf2442 found that it was an alias for the previously attempted URL. Stephen asked about the instance’s installation and version, and jhf2442 reported that it was installed using a Docker container and was up to date according to the admin panel.

Ultimately, jhf2442 restored their site from a previous backup, regaining access but still unsure what went wrong.

Hi,

I wanted to activate SSO to use discourse as an SSO provider for Mediawiki, but it looks like I’ve activated external SSO for discourse itself :frowning:

I’ve read oother threads describing workarounds, but they don’t work:

  • SiteSettings.enable_sso=false through ruby console → login form displays “unknown error” upon submission of user/password
  • use backdoor /users/admin-login → blank screen with “[“BAD CSRF”]” after submiting the form
  • selecting “resend password” in login form displays a 403 error in the dialog box upon submission

As I’ve logged out as admin (deleted all my cookies), I can’t access /logs to see if there’s some hint to be found there

So … anything I could do the regain access to my site ?

Many thanks

You can disable SSO from the rails console or use the admin login path. Both are documented here on Meta if you use the search.

that’s what I did, but it still doesn’t work !
or is there another besides the ones I’ve listed in my original post ?

Correction, because I saw a typo: SiteSetting.enable_sso (no s in Setting !)

and finally : SiteSetting.enable_local_logins = true also didn’t help

Try https://<yoursiteurl>/u/admin-login/

/u seems to be an alias to /users :frowning:

How was this instance installed? What version is it?

docker container
2 days ago it was reported to be up to date in the admin panel (as I have no access to it I can’t cehck the version)

Problem worked around by restoring from a previous backup. Still no idea what went wrong :frowning: but at least I have gained back access to my site