Configura iscrizione e accesso con Auth0 usando il 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 Mi Piace

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

1 Mi Piace

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 Mi Piace

@riking see this post for why I had that.

1 Mi Piace

@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 Mi Piace

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

Ruth

3 Mi Piace

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 Mi Piace

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 Mi Piace

Ci sono aggiornamenti a riguardo?

Ho un sito che utilizza oauth2-basic con Auth0. È l’unico metodo di autenticazione disponibile e gli accessi locali sono disabilitati. I nuovi utenti non vengono creati sul lato Discourse e i tentativi di accesso falliscono in modo silenzioso, quindi non è possibile aggiungere nuovi utenti. Non è chiaro se il problema sia iniziato con l’aggiornamento alla beta9 o quando siamo passati a oauth2-basic alcune settimane fa.

Al momento, anche dover cliccare su una schermata “crea il tuo account” sarebbe assolutamente accettabile.

MODIFICA: Un componente del tema impediva la visualizzazione della finestra modale per i nuovi utenti. Sono comunque interessato a saltare questo passaggio.

1 Mi Piace

È utile sapere che impostando logout redirect su https://SITENAME.auth0.com/v2/logout (o https://SITENAME.auth0.com/v2/logout?returnTo=SOME_URL_THAT_IS_IN_ALLOWED_LOGOUT_URLS), poi disconnettendosi da Discourse, si verrà disconnessi anche da Auth0.

5 Mi Piace

È ora disponibile in TUTTI I PLUGIN :tada:

7 Mi Piace

Sono riuscito a seguire la guida per configurare SSO con Auth0 e tutto funziona correttamente. Tuttavia, quando l’avatar_url viene aggiornato su Auth0, non si aggiorna sul lato Discourse. Ho provato a effettuare il login e il logout sia per account amministratore che per account normali. Per chiarezza: l’avatar viene impostato correttamente al momento della registrazione, ma non viene aggiornato successivamente su Discourse. Posso vedere l’output di debug nei log e il user_json contiene effettivamente l’avatar_url aggiornato.

2 Mi Piace

@blake puoi dirmi per favore se si tratta di un problema noto o se devo correggere qualcosa nella mia configurazione?

Alla fine ho disabilitato il plugin oauth2_basic e ho seguito il flusso SSO utilizzando le regole di Auth0 come descritto qui: https://blog.leog.me/discourse-sso-with-auth0-e49486d0294a

Una modifica che ho apportato è stata quella di memorizzare il sso_secret nella configurazione delle regole anziché nei metadati dell’applicazione.

Includi anche il client_id
https://auth0.com/docs/logout/redirect-users-after-logout