Open dumbasPL opened 3 months ago
Yeah definitely should deal with this.
Perhaps also if both first and last name are empty, use the email as one of them so it sort of works?
I'm also not sure how much of the UI relies on both names being present but definitely worth testing.
Describe the bug
I'm getting a "Validation failed: Last name can't be blank" exception when trying to use OIDC.
To Reproduce
Expected behaviour
usernames without whitespace are supported.
Environment details
Temporary workaround for people facing this issue
change the
oidc.name_field
option to some random value that doesn't exist, doing so will prevent the names from being updatedAdditional information/context
the OIDC spec specifies the
name
field asEnd-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences.
so we can't assume that it will be in any particular format. And even if we do, the name field is configurable via theuidc.name_field
option and a user might want to use something likepreferred_username
instead, and that rarely will have any whitespace. The spec also includesgiven_name
,family_name
, andmiddle_name
as part of theStandard Claims
but not every provider supports them. See: https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.5.1I have 10+ services configured in my OIDC provider and all of them can handle usernames just fine. Imo assuming anything about the name field is a recipe for disaster. The spec even mentions
possibly including titles and suffixes, ordered according to the End-User's locale and preferences.
, and people all over the world can have different formats, prefixes, suffixes, middle names, etc.problematic line: https://github.com/postalserver/postal/blob/da90e75036c27482699921613d838f4058a100e7/app/models/user.rb#L127
trace:
log (details redacted with
<REDACTED>
):