Skip to content

fix: parse sso name when first_name and family_name arent given (compatibility with dex)#390

Merged
gusfcarvalho merged 1 commit intomainfrom
gc-fix-sso-name-parsinng
May 4, 2026
Merged

fix: parse sso name when first_name and family_name arent given (compatibility with dex)#390
gusfcarvalho merged 1 commit intomainfrom
gc-fix-sso-name-parsinng

Conversation

@gusfcarvalho
Copy link
Copy Markdown
Contributor

No description provided.

…atibility with dex)

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copilot AI review requested due to automatic review settings May 4, 2026 12:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves OIDC SSO compatibility by deriving FirstName/LastName from the name (display name) claim when structured name claims aren’t present, which matches behavior needed for providers like Dex that may omit given_name/family_name.

Changes:

  • Add a fallback in BaseOIDCProvider.GetUserInfo to split the name claim into FirstName and LastName when both structured fields are empty.
  • Introduce splitDisplayName helper for consistent splitting behavior.
  • Add unit tests covering the fallback behavior, preserving structured claims, and splitDisplayName edge cases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/service/sso/providers/base_oidc.go Adds display-name splitting fallback for missing structured OIDC name claims.
internal/service/sso/providers/base_oidc_test.go Adds tests validating the new fallback and helper behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gusfcarvalho gusfcarvalho merged commit 790ffcc into main May 4, 2026
8 checks passed
@gusfcarvalho gusfcarvalho deleted the gc-fix-sso-name-parsinng branch May 4, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants