# Email field not populated on SSO User?

**URL:** <https://meta.discourse.org/t/email-field-not-populated-on-sso-user/97622>\
**Category:** SSO\
**Created:** [20 september 2018 om 07:19 UTC](https://meta.discourse.org/t/email-field-not-populated-on-sso-user/97622 "2018-09-20T07:19:10Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Julian\_Elve](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julian_elve/32/119540_2.png) [@Julian\_Elve](https://meta.discourse.org/u/Julian_Elve)\
**Post date:** [20 september 2018 om 11:36 UTC](https://meta.discourse.org/t/email-field-not-populated-on-sso-user/97622/7 "2018-09-20T11:36:24Z")

</div>

> [@pfaffman](#):
>
> You can send group membership as part of the SSO load. If I understand your situation that’s what your want to do and you won’t need to check the user record.

I may well add that later, but for a number of reasons, including:

- group membership is volatile (e.g. existing customer purchases a new training programme that has an associated group/category)
- how our different systems are (or are not) coupled
- subtle differences in our SSO registration / authentication flow depending on whether user is creating an SSO account with username/password or authenticating to our SSO using a federated identity like Google

the safest and simplest thing to do is to check on login each time.

However because the email field IS populated in the user\_login webhook I won’t need to query the Discourse user for email (that was a bit of a side track). I’m still going to have to query the user to add them to a group because that endpoint needs usernames not ids, and for a whole set of reasons I won’t bore you with we aren’t tracking the Discourse username externally

---

_[View the full topic](https://meta.discourse.org/t/email-field-not-populated-on-sso-user/97622)._
