# SSO locked me out of Discourse!

**URL:** <https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856>\
**Category:** SSO\
**Created:** [2015年一月10日 16:57 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856 "2015-01-10T16:57:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![TwelveMonkeys](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@TwelveMonkeys](https://meta.discourse.org/u/TwelveMonkeys)\
**Post date:** [2015年一月10日 16:57 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/1 "2015-01-10T16:57:06Z")

</div>

I’m trying out SSO for my Wordpress site and it seems that if you get the configuration wrong, you can get locked out of your admin account.

Unfortunately, I am but a lowly publisher/admin. So the instructions here [https://meta.discourse.org/t/sign-in-error-sso-may-be-enabled/15834](https://meta.discourse.org/t/sign-in-error-sso-may-be-enabled/15834) are no use to me. I am only vaguely technical - I paid a developer to set up Discourse on Digital Ocean for me.

I know what SSH is, but I haven’t touched a command line for several years. I either need some real layman step-by-step instructions, or I’ll have to pay another third party to sort this out.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)\
**Post date:** [2015年一月10日 17:01 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/2 "2015-01-10T17:01:31Z")

</div>

You can view this post

> [@Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045):
>
> [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) is a core Discourse feature that allows you to configure “Single Sign-On (SSO)” to completely outsource all user registration and login from Discourse to another site. Offered to our [pro, business and enterprise hosting customers](https://discourse.org/pricing). information_source (Feb 2021) ‘[Discourse SSO](https://meta.discourse.org/t/13045?silent=true)’ is now ‘[DiscourseConnect](https://meta.discourse.org/t/13045?silent=true)’. If you are running an old version of Discourse, the settings below will be named sso\_... rather than discourse\_connect\_... The Problem Many sites wishing to integrate wit…

> [@Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045/1):
>
> What if you check it by mistake?
> 
> If you check enable\_sso by mistake and need to revert to the original state and no longer have access to the admin panel
> 
> run:
> 
> ./launcher enter app  
> rails c  
> irb \> SiteSetting.enable\_sso = false  
> irb \> exit  
> exit

---

<div class="post-metadata">

**Author:** ![TwelveMonkeys](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@TwelveMonkeys](https://meta.discourse.org/u/TwelveMonkeys)\
**Post date:** [2015年一月10日 17:24 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/3 "2015-01-10T17:24:07Z")

</div>

Thanks for the swift reply, but as I said, I paid a developer to set this up.

What I need are step-by-step instructions for Digital Ocean - where do I run these commands?

Sorry for being a newbie, but I’m evaluating Discourse and need to find out if I can administrate this forum myself or whether I need to pay someone to take care of the server side of things.

Thanks.

---

<div class="post-metadata">

**Author:** ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)\
**Post date:** [2015年一月10日 17:31 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/4 "2015-01-10T17:31:54Z")

</div>

Do you know how to login to your Digital Ocean VPS using a SSH client ?

---

<div class="post-metadata">

**Author:** ![TwelveMonkeys](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@TwelveMonkeys](https://meta.discourse.org/u/TwelveMonkeys)\
**Post date:** [2015年一月10日 17:47 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/5 "2015-01-10T17:47:16Z")

</div>

I’ve never done it before on Digital Ocean, but I’m sure I could work it out. Can I use the Terminal on my MacBook?

If so what info will I need to run the commands above?

Many thanks

---

<div class="post-metadata">

**Author:** ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)\
**Post date:** [2015年一月10日 17:51 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/6 "2015-01-10T17:51:18Z")

</div>

Yes. You can use Terminal on MacBook to login via ssh to your VPS.  
After login to your VPS. run these command

```plaintext
# cd /var/discourse
# ./launcher enter app
$ rails c
[1] pry(main)> SiteSetting.enable_sso = false
[2] pry(main)> exit
$ exit

```

---

<div class="post-metadata">

**Author:** ![TwelveMonkeys](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@TwelveMonkeys](https://meta.discourse.org/u/TwelveMonkeys)\
**Post date:** [2015年一月10日 18:03 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/7 "2015-01-10T18:03:10Z")

</div>

thanks very much!

However I managed to reset the forum without having to open a command line.

By typing in the IP address, not domain name of my forum I was able to login and uncheck the SSO settings .

Now the forum is back up and running. Many thanks for your assistance!

---

<div class="post-metadata">

**Author:** ![Moter8](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moter8/32/120941_2.png) [@Moter8](https://meta.discourse.org/u/Moter8)\
**Post date:** [2015年一月10日 18:30 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/8 "2015-01-10T18:30:36Z")

</div>

How did you even install Discourse without ever connecting to the server before?

Anyway: Your mac ships with `Terminal` which lets you connect to the server too. Open it and type `ssh <yourserver_IP_or_domain>` and you will be able to log in as long as you didn’t use some private key when setting up the server.

---

<div class="post-metadata">

**Author:** ![TwelveMonkeys](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@TwelveMonkeys](https://meta.discourse.org/u/TwelveMonkeys)\
**Post date:** [2015年一月10日 19:06 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/9 "2015-01-10T19:06:52Z")

</div>

Thank you for the advice.

FYI I’m a publisher, I don’t have a background in server administration - somebody else set the forum up for me.

Whilst I’m pretty technical, I need to feel confident that I can’t ‘break’ the installation purely by changing some settings in the admin panel.

This to me is a test as to whether Discourse will work for me and hence be adopted by the masses -like where Wordpress is at now.

---

<div class="post-metadata">

**Author:** ![Moter8](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moter8/32/120941_2.png) [@Moter8](https://meta.discourse.org/u/Moter8)\
**Post date:** [2015年一月10日 19:35 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/10 "2015-01-10T19:35:26Z")

</div>

Oh I see, that’s fine too, Discourse _Is_ fairly easy to administer for non-technical people too.

Back to Topic: the “Enable SSO” Option should have some sort of warning (Don’t enable this unless you know what it is for)

---

<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:** [2015年一月12日 08:54 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/11 "2015-01-12T08:54:50Z")

</div>

Good point I added this to the end of the site setting description for `enable_sso`

> (WARNING: can prevent anyone from logging in if not properly configured when enabled; also disables invites)

---

<div class="post-metadata">

**Author:** ![kpfleming](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kpfleming/32/116414_2.png) [@kpfleming](https://meta.discourse.org/u/kpfleming)\
**Post date:** [2015年一月12日 20:50 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/12 "2015-01-12T20:50:41Z")

</div>

This is a configuration bug that you’ll probably want to get corrected, otherwise your users will _also_ be able to bypass your SSO.

---

<div class="post-metadata">

**Author:** ![TwelveMonkeys](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@TwelveMonkeys](https://meta.discourse.org/u/TwelveMonkeys)\
**Post date:** [2015年一月12日 22:27 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/13 "2015-01-12T22:27:40Z")

</div>

Thanks for the advice but I’m skipping SSO for the moment.

Too complicated to set up for non sysadmin types like me.

---

<div class="post-metadata">

**Author:** ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)\
**Post date:** [2015年一月13日 15:02 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/14 "2015-01-13T15:02:31Z")

</div>

There is a Wordpress plugin for this  
[https://meta.discourse.org/t/wp-discourse-sso-plugin/23245](https://meta.discourse.org/t/wp-discourse-sso-plugin/23245)

---

<div class="post-metadata">

**Author:** ![TwelveMonkeys](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@TwelveMonkeys](https://meta.discourse.org/u/TwelveMonkeys)\
**Post date:** [2015年一月13日 17:31 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/15 "2015-01-13T17:31:52Z")

</div>

Thanks, yes I have the Wordpress plugin installed - it’s pretty intuitive, however I’m struggling with the Discourse settings, in particular the following:

 ![](https://global.discourse-cdn.com/meta/original/3X/2/2/22cdf973ef744661e697d3108d8219d7b77b8448.png)

I have set the secret key, but I have no idea what the SSO url is and the implications of the override settings.

---

<div class="post-metadata">

**Author:** ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)\
**Post date:** [2015年一月13日 17:52 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/16 "2015-01-13T17:52:31Z")

</div>

You can read offcial instruction here

> [@Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045):
>
> [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) is a core Discourse feature that allows you to configure “Single Sign-On (SSO)” to completely outsource all user registration and login from Discourse to another site. Offered to our [pro, business and enterprise hosting customers](https://discourse.org/pricing). information_source (Feb 2021) ‘[Discourse SSO](https://meta.discourse.org/t/13045?silent=true)’ is now ‘[DiscourseConnect](https://meta.discourse.org/t/13045?silent=true)’. If you are running an old version of Discourse, the settings below will be named sso\_... rather than discourse\_connect\_... The Problem Many sites wishing to integrate wit…

---

<div class="post-metadata">

**Author:** ![TwelveMonkeys](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@TwelveMonkeys](https://meta.discourse.org/u/TwelveMonkeys)\
**Post date:** [2015年一月19日 10:34 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/17 "2015-01-19T10:34:52Z")

</div>

Many thanks for your help and encouragement.

Finally managed to get SSO working!

---

<div class="post-metadata">

**Author:** ![TwelveMonkeys](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@TwelveMonkeys](https://meta.discourse.org/u/TwelveMonkeys)\
**Post date:** [2015年一月19日 10:42 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/18 "2015-01-19T10:42:31Z")

</div>

Thanks, I got this work finally. It seems that my server works a little differently. Being a newb, I thought it might help others with the same issue:

the irb command was giving me errors

> NameError: undefined local variable or method `irb’ for main:Object

Instead I was getting this prompt after ‘rails c’

> 1] pry(main)\>

This might as well have been in Sanskrit, but a little Googling told me this was an alternate to irb so I just entered the command:

> SiteSetting.enable\_sso = false  
> exit

And that seemed to work.

Thanks again!

---

<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:** [2015年一月19日 22:39 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/19 "2015-01-19T22:39:56Z")

</div>

Fixed the instructions for future travelers.

---

<div class="post-metadata">

**Author:** ![Rafiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rafiki/32/37915_2.png) [@Rafiki](https://meta.discourse.org/u/Rafiki)\
**Post date:** [2015年三月17日 05:41 UTC](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856/20 "2015-03-17T05:41:12Z")

</div>

Appreciate help guys. Have ssh into my bitnami discourse stack and can’t get the commands to work. When I run rails C I get this error before I even get to running the = false command.

Looks like your app’s ./bin/rails is a stub that was generated by Bundler.

In Rails 4, your app’s bin/ directory contains executables that are versioned  
like any other source code, rather than stubs that are generated on demand.

Here’s how to upgrade:

bundle config --delete bin # Turn off Bundler’s stub generator  
rake rails:update:bin # Use the new Rails 4 executables  
git add bin # Add bin/ to source control

You may need to remove bin/ from your .gitignore as well.

Any advice appreciate as need to get the SSO turned off asap. Thanks!

[下一頁](https://meta.discourse.org/t/sso-locked-me-out-of-discourse/23856.md?page=2)
