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

**URL:** https://meta.discourse.org/t/how-to-configure-the-sso-authorization-url-via-config-without-using-the-admin-panel/84572
**Category:** SSO
**Created:** [4월 4, 2018, 2:03오후 UTC](https://meta.discourse.org/t/how-to-configure-the-sso-authorization-url-via-config-without-using-the-admin-panel/84572 "2018-04-04T14:03:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![shahidmir](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shahidmir](https://meta.discourse.org/u/shahidmir)
#### Post date: [4월 4, 2018, 2:03오후 UTC](https://meta.discourse.org/t/how-to-configure-the-sso-authorization-url-via-config-without-using-the-admin-panel/84572/1 "2018-04-04T14:03:33Z")

</div>

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

---

<div class="post-metadata">

### Author: ![swarnava](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swarnava/32/120151_2.png) [@swarnava](https://meta.discourse.org/u/swarnava)
#### Post date: [4월 4, 2018, 3:05오후 UTC](https://meta.discourse.org/t/how-to-configure-the-sso-authorization-url-via-config-without-using-the-admin-panel/84572/2 "2018-04-04T15:05:44Z")

</div>

Hey there,

It is mentioned in the first post on this topic:

> [@Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045/1):
>
> [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…

from server console run:

```plaintext
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

---

<div class="post-metadata">

### Author: ![shahidmir](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shahidmir](https://meta.discourse.org/u/shahidmir)
#### Post date: [4월 4, 2018, 3:47오후 UTC](https://meta.discourse.org/t/how-to-configure-the-sso-authorization-url-via-config-without-using-the-admin-panel/84572/3 "2018-04-04T15:47:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![shahidmir](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shahidmir](https://meta.discourse.org/u/shahidmir)
#### Post date: [4월 4, 2018, 4:23오후 UTC](https://meta.discourse.org/t/how-to-configure-the-sso-authorization-url-via-config-without-using-the-admin-panel/84572/4 "2018-04-04T16:23:14Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [4월 4, 2018, 10:44오후 UTC](https://meta.discourse.org/t/how-to-configure-the-sso-authorization-url-via-config-without-using-the-admin-panel/84572/5 "2018-04-04T22:44:46Z")

</div>

> [@shahidmir](#):
>
> Could I ask, would this need to be done manually once discourse is deployed?

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.

---

<div class="post-metadata">

### Author: ![shahidmir](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shahidmir](https://meta.discourse.org/u/shahidmir)
#### Post date: [4월 5, 2018, 9:30오전 UTC](https://meta.discourse.org/t/how-to-configure-the-sso-authorization-url-via-config-without-using-the-admin-panel/84572/6 "2018-04-05T09:30:41Z")

</div>

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