A user, johncs, inquired about what happens when redirecting a user to /session/sso_login without providing a username field in the payload, as their account system only uses email for login. Falco responded that Discourse will auto-generate a username using other provided fields such as email and name, referencing the User Name Suggester code. johncs appreciated the answer, finding it crucial for their implementation of Single Sign-On (SSO).
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. 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.