使用 OAuth2 Basic 插件配置 Auth0 的注册和登录

@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 个赞

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

1 个赞

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 个赞

@riking see this post for why I had that.

1 个赞

@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 个赞

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

Ruth

3 个赞

抱歉 @charchar,我不明白你是如何解决“错误提示但没有其他选项”这个问题的。我就卡在这一步了……

你好!

如果用户是 Discourse 的新用户,那么在身份验证后,会弹出一个窗口显示新用户的信息。是否有可能自动创建 Discourse 用户,而不显示此窗口?该用户已在 Auth0 上创建……

目前还无法实现,但我们希望尽快添加该功能

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

2 个赞

discourse-saml 插件的情况也一样吗?

SAML 插件会自动创建用户。我们计划在其他插件中提供相同的功能。

3 个赞

关于这个问题有更新吗?

我有一个网站正在使用 auth0 的 oauth2-basic 进行认证。这是唯一的认证方式,本地登录已禁用。新用户无法在 Discourse 端创建,且登录会静默失败,因此无法添加新用户。目前尚不清楚这个问题是从 beta9 升级开始的,还是几周前切换到 oauth2-basic 时出现的。

目前来看,即使需要点击“创建您的账户”屏幕也可以接受。

编辑:一个主题组件阻止了新用户弹窗的显示。不过,我仍然希望跳过这一步。

1 个赞

了解以下设置会有所帮助:将 logout redirect 设置为 https://SITENAME.auth0.com/v2/logout(或 https://SITENAME.auth0.com/v2/logout?returnTo=SOME_URL_THAT_IS_IN_ALLOWED_LOGOUT_URLS),这样在 Discourse 中登出时,也会从 Auth0 登出。

5 个赞

现在所有插件都已支持!:tada:

7 个赞

已成功按照指南使用 Auth0 配置了 SSO,一切运行正常。只是,当 Auth0 中的 avatar_url 更新后,Discourse 端并未同步更新。我已尝试为管理员账户和普通账户分别进行登录和注销操作。需要说明的是,头像在注册时设置正确,但之后在 Discourse 上不会更新。我可以在日志中看到调试输出,且 user_json 中确实包含了更新后的 avatar_url

2 个赞

@blake 能否请您告知这是否是一个已知问题,或者我的设置中是否有需要修正的地方?

我最终禁用了 oauth2_basic 插件,并按照此处描述的 Auth0 规则执行了 SSO 流程:https://blog.leog.me/discourse-sso-with-auth0-e49486d0294a

我进行的一项更改是将 sso_secret 存储在规则配置中,而不是存储在应用程序的元数据中。

同时包含 client_id
https://auth0.com/docs/logout/redirect-users-after-logout