如何配置OIDC将用户名设置为我的身份验证提供商返回的电子邮件帐户名称或类似用户名的值?

Hi there,

How can I configure the OIDC to set the Username as the email account name or a username like value returned from my auth providers. In below screenshot, the Username user2091 looks like generated from a pattern, which isn’t what I want (It’s not editable neither probably caused by some settings I did). How can I make it as “abc” if the email return as “abc@example.com”?

In my discourse OIDC config, I only set openid email profile besides the minimal config required like example. Should I set something else,
for example, openid connect claims for something?

1 个赞

The Discourse OIDC plugin will use the ‘nickname’ claim provided by the identity provider. So you’ll need to review the documentation for your identity provider and work out how to make it send the ‘nickname’ value that you’d like.

4 个赞

Thanks @david. That’s my providers not return the value. Able to display the username from the providers now.

1 个赞