Configurar cadastro e login com Auth0 usando o Plugin Básico OAuth2

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

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

1 curtida

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 curtida

@riking see this post for why I had that.

1 curtida

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

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

Ruth

3 curtidas

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 curtidas

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 curtidas

Há alguma atualização sobre isso?

Tenho um site que usa oauth2-basic com Auth0. É o único método de autenticação disponível e os logins locais estão desabilitados. Novos usuários não estão sendo criados no lado do Discourse e os logins falham silenciosamente, então não há como adicionar novos usuários. Não está claro se isso começou na atualização para a versão beta9 ou quando mudamos para o oauth2-basic algumas semanas atrás.

Neste ponto, até mesmo ter que clicar em uma tela de “crie sua conta” seria totalmente aceitável.

EDIT: Um componente de tema estava impedindo que o modal de novo usuário aparecesse. Ainda estou interessado em pular essa etapa, no entanto.

1 curtida

É útil saber que definir logout redirect para https://SITENAME.auth0.com/v2/logout (ou https://SITENAME.auth0.com/v2/logout?returnTo=SOME_URL_THAT_IS_IN_ALLOWED_LOGOUT_URLS) fará com que, ao sair do Discourse, você também saia do Auth0.

5 curtidas

Agora está disponível em TODOS OS PLUGINS :tada:

7 curtidas

Consegui seguir o guia para configurar o SSO usando o Auth0 e tudo funciona bem. Apenas que, quando o avatar_url é atualizado no Auth0, ele não é atualizado no lado do Discourse. Já tentei fazer login e logout tanto em contas de administrador quanto em contas comuns. Para ficar claro, o avatar é definido corretamente no momento do cadastro, mas não é atualizado posteriormente no Discourse. Posso ver a saída de depuração nos logs e o user_json contém o avatar_url atualizado.

2 curtidas

@blake, você poderia me dizer se isso é um problema conhecido ou se preciso corrigir algo na minha configuração?

Acabei desativando o plugin oauth2_basic e segui o fluxo de SSO usando as regras do Auth0, conforme descrito aqui: https://blog.leog.me/discourse-sso-with-auth0-e49486d0294a

Uma alteração que fiz foi armazenar o sso_secret na configuração das regras, em vez de nos metadados do aplicativo.

Inclua também o client_id
https://auth0.com/docs/logout/redirect-users-after-logout