# User email address at account creation (through oAuth) incorrect

**URL:** https://meta.discourse.org/t/user-email-address-at-account-creation-through-oauth-incorrect/70361
**Category:** Support
**Created:** [2017 年 9 月 19 日午後 12:58 UTC](https://meta.discourse.org/t/user-email-address-at-account-creation-through-oauth-incorrect/70361 "2017-09-19T12:58:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Ryan\_Nix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryan_nix/32/78712_2.png) [@Ryan\_Nix](https://meta.discourse.org/u/Ryan_Nix)
#### Post date: [2017 年 9 月 19 日午後 12:58 UTC](https://meta.discourse.org/t/user-email-address-at-account-creation-through-oauth-incorrect/70361/1 "2017-09-19T12:58:24Z")

</div>

Hello,

I’m using the Azure AD plugin for authentication. The [AzureAD oAuth plug-in](https://github.com/discourse/discourse-azure-ad) 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](mailto:r-nix@mycollege.edu) but the oAuth plugin is making the email address [rtn456@ad.mycollege.edu](mailto: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

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2017 年 9 月 19 日午後 3:25 UTC](https://meta.discourse.org/t/user-email-address-at-account-creation-through-oauth-incorrect/70361/2 "2017-09-19T15:25:36Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Ryan\_Nix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryan_nix/32/78712_2.png) [@Ryan\_Nix](https://meta.discourse.org/u/Ryan_Nix)
#### Post date: [2017 年 9 月 19 日午後 4:30 UTC](https://meta.discourse.org/t/user-email-address-at-account-creation-through-oauth-incorrect/70361/3 "2017-09-19T16:30:32Z")

</div>

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](https://meta.discourse.org/t/change-staff-email-address-from-console/42062). I’ll use that for now.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2017 年 9 月 19 日午後 4:33 UTC](https://meta.discourse.org/t/user-email-address-at-account-creation-through-oauth-incorrect/70361/4 "2017-09-19T16:33:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2019 年 10 月 8 日午前 10:41 UTC](https://meta.discourse.org/t/user-email-address-at-account-creation-through-oauth-incorrect/70361/5 "2019-10-08T10:41:40Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2023 年 6 月 9 日午前 5:10 UTC](https://meta.discourse.org/t/user-email-address-at-account-creation-through-oauth-incorrect/70361/6 "2023-06-09T05:10:52Z")

</div>



---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2023 年 6 月 9 日午前 7:19 UTC](https://meta.discourse.org/t/user-email-address-at-account-creation-through-oauth-incorrect/70361/7 "2023-06-09T07:19:11Z")

</div>


