Configurar registro e inicio de sesión con Auth0 usando el plugin OAuth2 Basic

@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

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

I am stuck on the same problem! :worried:

1 me gusta

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

1 me gusta

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!

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

1 me gusta

@riking see this post for why I had that.

1 me gusta

@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.

I’ll update the original post with the correct values you need.

And thanks @jerdog for the help :slight_smile:!

4 Me gusta

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

Ruth

3 Me gusta

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

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 …

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

2 Me gusta

Is the same situation with the discourse-saml plugin?

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

3 Me gusta

¿Hay alguna novedad sobre esto?

Tengo un sitio que usa oauth2-basic con Auth0. Es el único método de autenticación disponible y los inicios de sesión locales están desactivados. Los nuevos usuarios no se están creando en el lado de Discourse y los inicios de sesión fallan en silencio, por lo que no hay forma de agregar nuevos usuarios. No está claro si esto comenzó con la actualización a beta9 o cuando cambiamos a oauth2-basic hace algunas semanas.

En este punto, incluso tener que hacer clic en una pantalla de “crear tu cuenta” estaría bien.

EDIT: Un componente del tema impedía que apareciera el modal de nuevo usuario. Aun así, sigo interesado en omitir ese paso.

1 me gusta

Es útil saber que establecer logout redirect en https://SITENAME.auth0.com/v2/logout (o https://SITENAME.auth0.com/v2/logout?returnTo=SOME_URL_THAT_IS_IN_ALLOWED_LOGOUT_URLS) hace que, al cerrar sesión en Discourse, también se cierre sesión en Auth0.

5 Me gusta

¡Ahora está disponible en TODOS LOS COMPLEMENTOS :tada:

7 Me gusta

Pude seguir la guía para configurar SSO usando Auth0 y todo funciona correctamente. Sin embargo, cuando se actualiza el avatar_url en Auth0, no se refleja en Discourse. He intentado iniciar y cerrar sesión tanto con cuentas de administrador como de usuario regular. Para aclarar: el avatar se establece correctamente al registrarse, pero no se actualiza posteriormente en Discourse. Puedo ver la salida de depuración en los registros y el user_json sí contiene el avatar_url actualizado.

2 Me gusta

@blake ¿podrías decirme si se trata de un problema conocido o si necesito corregir algo en mi configuración?

Al final, desactivé el plugin oauth2_basic y seguí el flujo de SSO usando las reglas de Auth0, como se describe aquí: https://blog.leog.me/discourse-sso-with-auth0-e49486d0294a

Un cambio que hice fue almacenar el sso_secret en la configuración de las reglas en lugar de en los metadatos de la aplicación.

Incluya también el client_id
https://auth0.com/docs/logout/redirect-users-after-logout