SSO locked me out of Discourse!


(Jeff Atwood) #11

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)


(Kevin P. Fleming) #12

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


#13

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

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


(Khoa Nguyen) #14

There is a Wordpress plugin for this


#15

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

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


(Khoa Nguyen) #16

You can read offcial instruction here


#17

Many thanks for your help and encouragement.

Finally managed to get SSO working!


#18

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!


(Kane York) #19

Fixed the instructions for future travelers.


(Rory Parkinson) #20

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!


(Sam Saffron) #21

Sorry, we are totally stretched for resources here, the only install method we support is the official docker based install


(Kane York) #22

Yeah, the rails c we’re looking for is this:

  - file:
     path: /usr/local/bin/rails
     chmod: +x
     contents: |
       #!/bin/bash
       # If they requested a console, load pry instead
       if [ "$@" == "c" -o "$@" == "console" ]
       then
        (cd /var/www/discourse && RAILS_ENV=production sudo -H -E -u discourse bundle exec pry -r ./config/environment)
       else
        (cd /var/www/discourse && RAILS_ENV=production sudo -H -E -u discourse bundle exec script/rails "$@")
       fi

@zogstrip bug - whitespace is being trimmed from the start of a fenced code block


(Rory Parkinson) #23

@sam Totally understand; should of avoided going for an easy install. Thanks for replying.


(Sam Saffron) #24

the docker install really is the “easy” install imo, it takes us less than 15 minutes including all the waiting.


(Rory Parkinson) #25

@sam - thanks. Will definitely have a look. Out of interest where would you choose to host it? I am currently trailing Amazon, but new to the whole environment and don’t want to make another mistake with the project due to time constraints. Thanks.


#26

AWS, Digitalocean, Linode… there definitely are some good providers out there.


(Kevin P. Fleming) #27

S3 is not a VM hosting service, it’s a storage service. I think you meant to say Amazon EC2.


(Régis Hanol) #28

Thanks for reporting that. I just pushed a fix :water_buffalo:

https://github.com/discourse/discourse/commit/aa41a9ce700a1a39d13c189d0f769694bce603aa


(Rory Parkinson) #29

@Moter8 - thanks for ideas; will check them out.


(walt c) #30

Here’s what I’m getting back from Terminal (also a newb developer who got locked out b/c of sso plugin w/ WP.

# cd /var/discourse
# ./launcher enter app
# $ rails c
$: command not found
# [1] pry(main)> SiteSetting.enable_sso = false
-bash: syntax error near unexpected token `('
# [2] pry(main)> exit
-bash: syntax error near unexpected token `('
# $ exit

Any help here would be greatly appreciated. Thanks!