How to configure the SSO Authorization URL via config (without using the admin panel)


(shahid) #1

Hi

I need to deploy discourse on 3 environments, each pointing to a different SSO Authorization URL.
Is there a way to set the SSO authorization URL without having to login and go via the admin panel?

Regards


(Swarnava) #2

Hey there,

It is mentioned in the first post on this topic:

from server console run:

cd /var/discourse
./launcher enter app
rails c
irb > SiteSetting.enable_sso = false
irb > SiteSetting.sso_url = "https://www.example.com/sso"
irb > SiteSetting.sso_secret = "Your_secret_token"
irb > exit
exit

Cheers


(shahid) #3

Hi thanks for your reply.

Could I ask, would this need to be done manually once discourse is deployed?

I was hoping to do this via some property setting in one the build files, so when the docker image is created the new setting takes effect?

Regards


(shahid) #4

Just to add further information:

I have checked that the SSO_URL value that I want to configure per environment in saved in the postgres DB.

I wonder if i need to run some postgres script when the application is built/deployed to update the URL value to what I want it?


(Jay Pfaffman) #5

How else would it be done?

Another way to do it is via the API. I built a settings uploader. You could edit by hand the settings you want to upload in a json file. There are some sample json files in the repo.

You’d still need to get an API key for each Discourse.


(shahid) #6

thanks for that, may just have to do it manually as a dev-ops task for now.