# Discourse als Identitätsanbieter nutzen (SSO, DiscourseConnect)

**URL:** <https://meta.discourse.org/t/use-discourse-as-an-identity-provider-sso-discourseconnect/32974>\
**Category:** Integrations\
**Tags:** sso, discourseconnect, how-to\
**Created:** [7. September 2015 um 09:19 UTC](https://meta.discourse.org/t/use-discourse-as-an-identity-provider-sso-discourseconnect/32974 "2015-09-07T09:19:21Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![reverend\_paco](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@reverend\_paco](https://meta.discourse.org/u/reverend_paco)\
**Post date:** [6. Mai 2016 um 19:48 UTC](https://meta.discourse.org/t/use-discourse-as-an-identity-provider-sso-discourseconnect/32974/12 "2016-05-06T19:48:15Z")

</div>

> [@fantasticfears](#):
>
> But isn’t a `create_new=false` enough? Or whatever name it is. You’ll get nonce and the flag back.

I wanted to give the client the flexibility of sending a failure to a different URL than the success url (return\_url). With complicated SSO architectures, this might be a requirement. (Selfishly, I wanted to make my return endpoint code less convoluted – i.e. on my side I have two codebases at /sso for success and /sso\_failure for failure).

Implicitly there are already two URLs (return\_url for success and ‘/login’ for failure) – I didn’t want to lose that.

So just to be clear, the payload you send to the Discourse endpoint should have _both_ `return_url` and `no_user_found_return_sso_url` if you want Discourse to send it back when no user is found. It should have `return_url` only if you are ok with Discourse forwarding to /login.

Should look like this:

1.If you want Discourse to forward to login if no user found, then:

`PAYLOAD = return_url=mydomain.com/clientendpoint&nonce=xE787euK`  
2. If you want Discourse to send back to you to the same endpoint for failure as success:

`PAYLOAD = no_user_found_return_sso_url=mydomain.com/clientendpoint&return_url=mydomain.com/clientendpoint&nonce=xE787euK`  
3. If you want Discourse to send back to you to a **different** endpoint as success:

`PAYLOAD = no_user_found_return_sso_url=sub.mydomain.com/handleNewUser&return_url=mydomain.com/clientendpoint&nonce=xE787euK`

Potentially a bit over-engineered, but that was my thought process.

---

_[View the full topic](https://meta.discourse.org/t/use-discourse-as-an-identity-provider-sso-discourseconnect/32974)._
