User email address at account creation (through oAuth) incorrect

AI 生成的摘要

Ryan_Nix reports an issue with the Azure AD oAuth plugin in Discourse, where user email addresses are incorrectly set at account creation (e.g., rtn456@ad.mycollege.edu instead of r-nix@mycollege.edu). Since the email is wrong at creation and cannot be changed via standard Discourse tools, Ryan seeks a manual fix. pfaffman suggests ensuring Azure AD sends the correct email and mentions that enabling sso overrides email might help — though Ryan finds this doesn’t fully resolve the issue, especially since Azure AD isn’t true SSO. Ryan ultimately opts to use the rails console to manually correct emails Ryan_Nix. pfaffman acknowledges the confusion around SSO vs. Azure AD and reaffirms that ideally, Azure AD should pass the correct email — but is glad the console suggestion helped move Ryan forward.

Hello,

I’m using the Azure AD plugin for authentication. The AzureAD oAuth plug-in is working great, except one thing: The user’s email address is incorrect. The plug-in is populating the email address as the short name and the Active Directory domain, neither of which are correct. Example: my email address is r-nix@mycollege.edu but the oAuth plugin is making the email address rtn456@ad.mycollege.edu. I can’t find a way to change the email address. The one set at account creation is incorrect so we can’t change it through the normal Discourse email change protocols.

Is there a way to edit the database manually if I can’t do it through the Discourse admin panel?

Thanks!

Ryan

I think that what you really want to do is figure out how to get AzureAD to send the right email address. And if sso overrides email is set your problem will go away.

Yes, you can use the rails console to make changes manually.

Thanks, Jay @pfaffman I just tried checking enable SSO, but that seems to override using AzureAD. Additionally, when I finally got the option to work (after unchecking enable SSO but leaving sso overrides email checked) the user still wasn’t able to change their email address upon account creation. Thanks for the suggestion to use the rails console. I’ll use that for now.

OH! I forgot that the AD stuff was not SSO. I think that you still want to figure out how to get the right email passed over and let AzureAD update email addresses, but I’m glad I gave you a hint that moved you forward.