# Discourse as SSO Provider: Login Error

**URL:** <https://meta.discourse.org/t/discourse-as-sso-provider-login-error/149572>\
**Category:** SSO\
**Created:** [April 28, 2020, 9:33am UTC](https://meta.discourse.org/t/discourse-as-sso-provider-login-error/149572 "2020-04-28T09:33:41Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![balupton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/balupton/32/255461_2.png) [@balupton](https://meta.discourse.org/u/balupton)\
**Post date:** [April 28, 2020, 9:33am UTC](https://meta.discourse.org/t/discourse-as-sso-provider-login-error/149572/1 "2020-04-28T09:33:41Z")

</div>

I’m following this guide here:

> [@Use Discourse as an identity provider (SSO, DiscourseConnect)](https://meta.discourse.org/t/using-discourse-as-a-sso-provider/32974):
>
> So you want to use Discourse as an identity provider for your own web app? Great! Let’s get started. Enable [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) provider setting Under Discourse admin site settings (/admin/site\_settings) enable setting enable discourse connect provider and add a secret string to discourse connect provider secrets (used to hash SSO payloads). Implement [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) in your web app: Generate a random [nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce). Let’s call this value NONCE. Save it temporarily so that you can verify it with the …

I am providing the correct signature, however for some reason discourse is not accepting it.

Here is the URL I am hitting:

> **[Bevry's Discourse - Accelerating collaborative wisdom.](https://discourse.bevry.me/session/sso_provider?sso=bm9uY2U9MGU4N2U5YWMtN2E4Zi00MzIwLTkwMTgtN2ExMDc1MzI0YzBkJnJldHVybl9zc29fdXJsPWh0dHBzOi8vZGlzY291cnNlLXZlcmlmeS5iZXZyeS53b3JrZXJzLmRldg%3D%3D&sig=fd218f1c75182cb12bfc8fc1e19dc26b8759f15e80c80d054735edb1b539fd54)**

Here is the error log for it:

```plaintext
Message

Verbose SSO log: Signature parse error

Bad signature for payload 

sso: redacted

sig: ae997097f358b7e08aa0568290b55ef6e2174077e96a1184153b1d8369d50f8

expected sig: ae997097f358b7e08aa0568290b55ef6e2174077e96a1184153b1d08369d50f8

Backtrace

/var/www/discourse/app/controllers/session_controller.rb:52:in `rescue in sso_provider'
/var/www/discourse/app/controllers/session_controller.rb:41:in `sso_provider'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.2.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.2.2/lib/abstract_controller/base.rb:196:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.2.2/lib/action_controller/metal/rendering.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.2.2/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/callbacks.rb:135:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.2.2/lib/abstract_controller/callbacks.rb:41:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.2.2/lib/action_controller/metal/rescue.rb:22:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.2.2/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'

Env

HTTP HOSTS: discuss.bevry.me

```

Here is the settings:

 ![Screen Shot 2020-04-28 at 7.33.09 pm](https://global.discourse-cdn.com/meta/original/3X/8/8/88ec4c33c5f65b0b92a8258dac679615698c2ee5.png)

Here is the code for the cloudflare worker:

```plaintext
redacted - will open-source later

```

However, this could be on our side, as there is a difference between:

- `ae997097f358b7e08aa0568290b55ef6e2174077e96a1184153b1d8369d50f8`
- `ae997097f358b7e08aa0568290b55ef6e2174077e96a1184153b1d08369d50f8`

Although I am not sure how to resolve that.

---

_[View the full topic](https://meta.discourse.org/t/discourse-as-sso-provider-login-error/149572)._
