# Configure sign up and log in with Auth0 using the OAuth2 Basic Plugin

**URL:** https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633
**Category:** Integrations
**Tags:** sso, oauth2, auth-plugins, how-to
**Created:** [June 16, 2017, 8:45pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633 "2017-06-16T20:45:59Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![RCheesley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rcheesley/32/455409_2.png) [@RCheesley](https://meta.discourse.org/u/RCheesley)
#### Post date: [July 26, 2018, 5:04pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/45 "2018-07-26T17:04:01Z")

</div>

@jerdog I have an open support ticket which one of your engineers has been working with me on. Happy for you to use that if it cuts time debugging! Ticket is #44440

Ruth

---

<div class="post-metadata">

### Author: ![Serginho\_Cintra](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Serginho\_Cintra](https://meta.discourse.org/u/Serginho_Cintra)
#### Post date: [July 26, 2018, 6:11pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/46 "2018-07-26T18:11:26Z")

</div>

I tried now with a new profile from an American site i.e. withou the “eu”: [https://testestukune.auth0.com/authorize](https://testestukune.auth0.com/authorize)

I am stuck on the same problem! 😟

---

<div class="post-metadata">

### Author: ![jerdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jerdog/32/122843_2.png) [@jerdog](https://meta.discourse.org/u/jerdog)
#### Post date: [July 26, 2018, 6:43pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/47 "2018-07-26T18:43:08Z")

</div>

@RCheesley / @Serginho_Cintra / @blake - we are looking into this and will get with you as soon as we see what’s going on

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [July 27, 2018, 6:32pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/48 "2018-07-27T18:32:43Z")

</div>

From the other thread:

**oauth2 json user id path** : `sub`  
**oauth2 json username path** : `nickname`  
**oauth2 json name path** : `name`  
**oauth2 json email path** : `email`

Quite different from the `identities.[].id` posted above!

---

<div class="post-metadata">

### Author: ![jerdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jerdog/32/122843_2.png) [@jerdog](https://meta.discourse.org/u/jerdog)
#### Post date: [July 27, 2018, 6:36pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/49 "2018-07-27T18:36:39Z")

</div>

Yes - things have likely changed from post #1 in terms of required settings

---

<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: [July 28, 2018, 4:51am UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/50 "2018-07-28T04:51:08Z")

</div>

> [@riking](#):
>
> Quite different from the `identities.[].id` posted above!

@riking see [this post](https://meta.discourse.org/t/how-to-use-auth0-with-the-oauth2-basic-plugin/64633/12) for why I had that.

---

<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: [July 28, 2018, 4:55am UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/51 "2018-07-28T04:55:59Z")

</div>

@RCheesley and @Serginho_Cintra

The key part that we were missing is that we need to specify a scope when we ask Auth0 for user info.

> **[Possible oauth2 problem with Discourse and Auth0 EU sites](https://community.auth0.com/t/possible-oauth2-problem-with-discourse-and-auth0-eu-sites/13681/9?u=oblakeerickson)**
>
> Awesome, thank you! The key fix was the scope needs to be passed to the authorize url value (I also updated all my oauth2 json values to match what you have above once I was getting a json result back from Auth0). Rather than adding the scope...

I’ll update the [original post](https://meta.discourse.org/t/how-to-use-auth0-with-the-oauth2-basic-plugin/64633) with the correct values you need.

And thanks @jerdog for the help 🙂!

---

<div class="post-metadata">

### Author: ![RCheesley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rcheesley/32/455409_2.png) [@RCheesley](https://meta.discourse.org/u/RCheesley)
#### Post date: [July 30, 2018, 5:18pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/52 "2018-07-30T17:18:07Z")

</div>

Fantastic, thanks so much for all the help guys, hugely appreciated!

Ruth

---

<div class="post-metadata">

### Author: ![ledimeo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ledimeo/32/157962_2.png) [@ledimeo](https://meta.discourse.org/u/ledimeo)
#### Post date: [November 8, 2019, 7:22pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/53 "2019-11-08T19:22:06Z")

</div>

Sorry @charchar, I don’t understand how you overcame the “error message with no other options” problem.  
I’m stopped just at this point..

---

<div class="post-metadata">

### Author: ![nahimov](https://avatars.discourse-cdn.com/v4/letter/n/aca169/32.png) [@nahimov](https://meta.discourse.org/u/nahimov)
#### Post date: [December 16, 2019, 12:17pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/55 "2019-12-16T12:17:08Z")

</div>

Hello!

If the user is new to Discourse, then, after authentication, a window appears with the data of the new user. Is it possible to somehow create a Discourse user automatically, without showing this window? The user is already created on Auth0 …

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [December 16, 2019, 12:28pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/56 "2019-12-16T12:28:49Z")

</div>

It is not currently possible, but we hope to add it soon

[https://meta.discourse.org/t/openid-connect-authentication-plugin/103632/56?u=david](https://meta.discourse.org/t/openid-connect-authentication-plugin/103632/56)

---

<div class="post-metadata">

### Author: ![nahimov](https://avatars.discourse-cdn.com/v4/letter/n/aca169/32.png) [@nahimov](https://meta.discourse.org/u/nahimov)
#### Post date: [December 16, 2019, 12:33pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/57 "2019-12-16T12:33:59Z")

</div>

Is the same situation with the `discourse-saml` plugin?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [December 16, 2019, 1:03pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/58 "2019-12-16T13:03:04Z")

</div>

The SAML plugin creates the user automatically. We’re planning to make the same functionality available in other plugins.

---

<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: [January 16, 2020, 6:40pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/59 "2020-01-16T18:40:59Z")

</div>

Is there an update on this?

I’ve got a site that’s using oauth2-basic with auth0. It is the only auth method available and local logins are disabled. New users are not getting created on the Discourse side and logins fail silently, so there is no way to add new users. It’s not clear if this started at the beta9 upgrade or when we switched to oauth2-basic some weeks ago.

At this point, even having to click through a “create your account” screen would be totally fine.

EDIT: A theme component was keeping the new user modal from popping up. Still interested in skipping that step, though.

---

<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: [January 16, 2020, 9:27pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/60 "2020-01-16T21:27:42Z")

</div>

It helps to know that setting `logout redirect` to `https://SITENAME.auth0.com/v2/logout` (or `https://SITENAME.auth0.com/v2/logout?returnTo=SOME_URL_THAT_IS_IN_ALLOWED_LOGOUT_URLS')` then logging out of Discourse will log out of auth0.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [July 6, 2020, 11:13am UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/62 "2020-07-06T11:13:52Z")

</div>

> [@david](#):
>
> We’re planning to make the same functionality available in other plugins.

It is now available in ALL THE PLUGINS 🎉

> [@Automatically provision accounts with external SSO provider? (skip Create New Account prompt)](https://meta.discourse.org/t/automatically-provision-accounts-with-external-sso-provider-skip-create-new-account-prompt/134511/6):
>
> I just added some new site settings which will help with this. To skip the ‘create new account’ screen, enable sso\_overrides\_username, sso\_overrides\_email and sso\_overrides\_name. Then to skip the popup completely, enable external\_auth\_skip\_create\_confirm If you don’t see that option, make sure you’re on the latest version of tests-passed.

---

<div class="post-metadata">

### Author: ![gcharang](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gcharang](https://meta.discourse.org/u/gcharang)
#### Post date: [December 4, 2020, 5:20pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/63 "2020-12-04T17:20:23Z")

</div>

Was able to follow the guide to setup SSO using Auth0 and everything works fine. Just that, when the `avatar_url` is updated in auth0 , it doesn’t get updated on the discourse side. I have tried login and logout for both admin and regular accounts. Just to be clear, the avatar is set correctly at signup, but isn’t updated later on discourse. I can see the debug output in the logs and the user\_json does have the updated `avatar_url`

---

<div class="post-metadata">

### Author: ![gcharang](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gcharang](https://meta.discourse.org/u/gcharang)
#### Post date: [December 7, 2020, 7:25am UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/64 "2020-12-07T07:25:55Z")

</div>

@blake can you please tell me if this is a known issue or if I need to correct anything in my setup?

---

<div class="post-metadata">

### Author: ![gcharang](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gcharang](https://meta.discourse.org/u/gcharang)
#### Post date: [December 18, 2020, 9:52am UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/65 "2020-12-18T09:52:17Z")

</div>

I ended up disabling the `oauth2_basic` plugin and followed the sso flow using Auth0 rules as described here: [https://blog.leog.me/discourse-sso-with-auth0-e49486d0294a](https://blog.leog.me/discourse-sso-with-auth0-e49486d0294a)

One change I did was to store the sso\_secret in the rules config rather than in application’s metadata

---

<div class="post-metadata">

### Author: ![JuanPabloOS](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@JuanPabloOS](https://meta.discourse.org/u/JuanPabloOS)
#### Post date: [March 11, 2021, 11:11pm UTC](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633/66 "2021-03-11T23:11:56Z")

</div>

Also include the client\_id  
[https://auth0.com/docs/logout/redirect-users-after-logout](https://auth0.com/docs/logout/redirect-users-after-logout)

[Previous page](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633.md?page=2)

[Next page](https://meta.discourse.org/t/configure-sign-up-and-log-in-with-auth0-using-the-oauth2-basic-plugin/64633.md?page=4)
