# Will Discourse ask for a username if it's not provided to /session/sso\_login?

**URL:** https://meta.discourse.org/t/will-discourse-ask-for-a-username-if-its-not-provided-to-session-sso-login/113185
**Category:** SSO
**Created:** [2 באפריל,‏ 2019,‏ 12:23am UTC](https://meta.discourse.org/t/will-discourse-ask-for-a-username-if-its-not-provided-to-session-sso-login/113185 "2019-04-02T00:23:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![johncs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johncs/32/135871_2.png) [@johncs](https://meta.discourse.org/u/johncs)
#### Post date: [2 באפריל,‏ 2019,‏ 12:23am UTC](https://meta.discourse.org/t/will-discourse-ask-for-a-username-if-its-not-provided-to-session-sso-login/113185/1 "2019-04-02T00:23:02Z")

</div>

My account system does not have a username field: users log in with an email only. What will happen when I redirect the user to `/session/sso_login` and the `username` field in the payload is blank? Will Discourse correctly ask the user for that missing information?

I don’t see mention of this case in the [SSO post](https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045). And although I see that `username` is an optional field, it seems like the implication is that it’s only optional if the user has a Discourse account already (ie: they aren’t new).

Thanks for your time! I realize I could code it up and just try it out myself, but it’d take a awhile to do so and I’m hoping one of you might be able to give a quick answer.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2 באפריל,‏ 2019,‏ 12:27am UTC](https://meta.discourse.org/t/will-discourse-ask-for-a-username-if-its-not-provided-to-session-sso-login/113185/2 "2019-04-02T00:27:59Z")

</div>

We will auto-generate the username using provided fields, like email and name:

> <https://github.com/discourse/discourse/blob/80eace4268a7a86197bc412ea76f7610fd8a1283/lib/user_name_suggester.rb>

---

<div class="post-metadata">

### Author: ![johncs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johncs/32/135871_2.png) [@johncs](https://meta.discourse.org/u/johncs)
#### Post date: [2 באפריל,‏ 2019,‏ 12:30am UTC](https://meta.discourse.org/t/will-discourse-ask-for-a-username-if-its-not-provided-to-session-sso-login/113185/3 "2019-04-02T00:30:37Z")

</div>

Wonderful, thank you. That’s a super useful answer, and a super useful feature 🙂: the difference between me being able to use SSO or not.
