# SSO client link giving error 500

**URL:** https://meta.discourse.org/t/sso-client-link-giving-error-500/86854
**Category:** WordPress
**Created:** [May 5, 2018, 11:03pm UTC](https://meta.discourse.org/t/sso-client-link-giving-error-500/86854 "2018-05-05T23:03:43Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [May 5, 2018, 11:03pm UTC](https://meta.discourse.org/t/sso-client-link-giving-error-500/86854/1 "2018-05-05T23:03:43Z")

</div>

**I have done the following to setup my word press as a SSO client:**

On wordpress

1. added all fields in the “connection” tab

2. added by secret key

3. 

On discourse

1. enable SSO provider

2. add SSO secret key

Although, when i try and sign in I get the following screen.

![Capture](https://global.discourse-cdn.com/meta/original/3X/0/b/0b8c1d1159d4c91d84fea3ce588499a0aeece51e.PNG)

 ![Capture](https://global.discourse-cdn.com/meta/original/3X/8/6/86fa462c8813701b49843d350f0f58001c6da8cf.PNG)

How could I fix this?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 6, 2018, 1:07am UTC](https://meta.discourse.org/t/sso-client-link-giving-error-500/86854/2 "2018-05-06T01:07:48Z")

</div>

> [@Sami\_Syed](#):
>
> How could I fix this?

My guess is that the problem is because of what you are asking about here:

> [@Edited htaccess and now im getting discourse sso expired error](https://meta.discourse.org/t/edited-htaccess-and-now-im-getting-discourse-sso-expired-error/86848):
>
> I am using my wordpress site to function as an SSO client. Meaning Discourse authenticates all users (logins, registrations, etc…). After editing my htaccess file to increase my wordpress site speed. I noticed that the following error started to appear when I try and login “discourse\_sso\_error=expired\_nonce”. I looked through the forum and found out that the issue is probably because of the htaccess file. Although, I want to know what exactly I should remove from it. So that I can keep my site…

Could you try using the default WordPress `.htaccess` configuration and see if you are still getting an error?

---

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [May 6, 2018, 1:14am UTC](https://meta.discourse.org/t/sso-client-link-giving-error-500/86854/3 "2018-05-06T01:14:19Z")

</div>

Instead I just reverted back to a wordpress backup from 2 days ago (with the original htaccess file). Although, the problem was still there. But when I cleared all my cache. cookies and history, it started to work again.

Kind of a weird situation but im glad I sorted it out.

---

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [May 6, 2018, 1:15am UTC](https://meta.discourse.org/t/sso-client-link-giving-error-500/86854/4 "2018-05-06T01:15:24Z")

</div>

Do you think the wp optimize plugin could have anything to do with this?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 6, 2018, 1:21am UTC](https://meta.discourse.org/t/sso-client-link-giving-error-500/86854/5 "2018-05-06T01:21:46Z")

</div>

> [@Sami\_Syed](#):
>
> Do you think the wp optimize plugin could have anything to do with this?

I don’t know. If you can figure that out, and why that is the case, please let us know. We can’t get into a lot of WordPress development on this forum, but it’s good to know about conflicts between the [WP Discourse](https://github.com/discourse/wp-discourse) plugin and any other WordPress plugins. It makes debugging issues a lot easier.

---

<div class="post-metadata">

### Author: ![nylen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nylen/32/125684_2.png) [@nylen](https://meta.discourse.org/u/nylen)
#### Post date: [July 23, 2019, 7:12am UTC](https://meta.discourse.org/t/sso-client-link-giving-error-500/86854/6 "2019-07-23T07:12:38Z")

</div>

For anyone else experiencing this error, I fixed it by filling in the `sso provider secrets` setting for the client domain name:

 ![00](https://global.discourse-cdn.com/meta/original/3X/6/5/65f1385843255589d104c0ea02567a589ac1ead6.png)

In the Discourse code, when this secret is not set, the call to `OpenSSL::HMAC.hexdigest` fails with the following error in the logs:

> TypeError (no implicit conversion of nil into String) /var/www/discourse/lib/single\_sign\_on.rb:114:in `hexdigest’

Here is the relevant code path:

- [discourse/lib/single\_sign\_on\_provider.rb at f364317625ee273d1e8983faa271831db912953b · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/f3643176/lib/single_sign_on_provider.rb#L21-L34)
- [discourse/lib/single\_sign\_on.rb at f364317625ee273d1e8983faa271831db912953b · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/f3643176/lib/single_sign_on.rb#L69)
- [discourse/lib/single\_sign\_on.rb at f364317625ee273d1e8983faa271831db912953b · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/f3643176/lib/single_sign_on.rb#L112)

This error message should definitely be improved! \_Edit: and it has been - see [https://meta.discourse.org/t/confusing-unpolished-error-message-when-using-discourse-as-sso-provider/123762\_](https://meta.discourse.org/t/confusing-unpolished-error-message-when-using-discourse-as-sso-provider/123762_)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [August 22, 2019, 7:12am UTC](https://meta.discourse.org/t/sso-client-link-giving-error-500/86854/7 "2019-08-22T07:12:47Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
