# How can we enable Auth0 SSO in Discourse

**URL:** https://meta.discourse.org/t/how-can-we-enable-auth0-sso-in-discourse/28422
**Category:** WordPress
**Tags:** sso, wordpress, discourseconnect
**Created:** [2015年五月7日 04:04 UTC](https://meta.discourse.org/t/how-can-we-enable-auth0-sso-in-discourse/28422 "2015-05-07T04:04:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![User143](https://avatars.discourse-cdn.com/v4/letter/u/a87d85/32.png) [@User143](https://meta.discourse.org/u/User143)
#### Post date: [2015年五月7日 04:04 UTC](https://meta.discourse.org/t/how-can-we-enable-auth0-sso-in-discourse/28422/1 "2015-05-07T04:04:27Z")

</div>

I have one new wordpress installation with PrimeTime WordPress + [Discourse SSO](https://meta.discourse.org/t/13045?silent=true)  
plugin for dicourse and wordpress integration and also i am using

Wordpress Auth0 plugin for auth0 integration.

The discourse integration and Auth0 integration Successfully done in  
wordpress.  
But when i logged in wordpress through the Auth0 i need to automatically  
login in discourse also (Single sign on). How can we make the single  
sign on in wordpress and discourse. Please suggest the better options..

---

<div class="post-metadata">

### Author: ![asanas](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@asanas](https://meta.discourse.org/u/asanas)
#### Post date: [2016年七月28日 04:52 UTC](https://meta.discourse.org/t/how-can-we-enable-auth0-sso-in-discourse/28422/2 "2016-07-28T04:52:55Z")

</div>

Hi, did you get a solution to your problem? I am also looking to achieve the same thing.

---

<div class="post-metadata">

### Author: ![rexi88](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rexi88](https://meta.discourse.org/u/rexi88)
#### Post date: [2017年六月19日 13:26 UTC](https://meta.discourse.org/t/how-can-we-enable-auth0-sso-in-discourse/28422/3 "2017-06-19T13:26:48Z")

</div>

I also am looking into this. Anyone got a solution.

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [2017年六月19日 16:51 UTC](https://meta.discourse.org/t/how-can-we-enable-auth0-sso-in-discourse/28422/4 "2017-06-19T16:51:02Z")

</div>

Have you tried to use the [Auth0 SSO plugin](https://github.com/auth0/discourse-plugin)?

You could also try using the [Discourse Basic Auth plugin](https://meta.discourse.org/t/oauth2-basic-support/33879) and follow [this guide](https://meta.discourse.org/t/how-to-use-auth0-with-the-oauth2-basic-plugin/64633) to setup Auth0. It’s not SSO, but if you use the same auth0 clientid as your wordpress site they shouldn’t have to create a new username/password since they already exist in auth0.

I’m not really sure but you might be able to get away with using the [wp-discourse plugin](https://github.com/discourse/wp-discourse) and setting up SSO to wordpress, but I’m guessing this might not work because Auth0 is the identity provider not wordpress.

---

<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: [2017年六月19日 18:06 UTC](https://meta.discourse.org/t/how-can-we-enable-auth0-sso-in-discourse/28422/5 "2017-06-19T18:06:21Z")

</div>

> [@blake](#):
>
> I’m not really sure but you might be able to get away with using the wp-discourse plugin and setting up SSO to wordpress,

I’ve looked at this recently with SAML authentication. With the way the plugin is currently setup, it won’t work for SSO login requests that are made from Discourse. What needs to happen for it to work is for the [Discourse SSO](https://meta.discourse.org/t/13045?silent=true) parameters to be passed to the Identity Provider, and then passed back to WordPress.

It looks like this could be done with Auth0 by sending the [Discourse SSO](https://meta.discourse.org/t/13045?silent=true) parameters in the RelayState query string. I’m going to add an action to the plugin that can be hooked into for doing things like this.

For now the easiest approach is to use Auth0 to log users in separately to both Discourse and WordPress.

---

<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: [2017年六月30日 04:05 UTC](https://meta.discourse.org/t/how-can-we-enable-auth0-sso-in-discourse/28422/6 "2017-06-30T04:05:44Z")

</div>

I’ve tried this with [WP Discourse](https://github.com/discourse/wp-discourse) and the Auth0 WordPress plugin. It seems to work correctly both with an Auth0 username/password and with Google authentication. Auth0 is preserving the [Discourse SSO](https://meta.discourse.org/t/13045?silent=true) redirect parameter over the login request.
