Skip to content

Conversation

@hayd1n
Copy link

@hayd1n hayd1n commented Dec 2, 2025

This change updates the OIDCUserInfoSchema to make the name and email fields optional because these values are already resolved through the configurable claimsMap. Since different OIDC Providers may use different claim names—or omit certain claims entirely—the schema should not require fields that are not guaranteed to exist.

This problem is particularly visible when using Synology SSO Server’s OIDC Provider. Synology SSO Server returns a username claim instead of name or preferred_username. Because the previous schema required name and email, parsing the userinfo response resulted in validation errors despite the presence of equivalent data under different claim keys.

By marking name and email as optional, the schema now correctly reflects real-world provider behavior, allowing claimsMap to map the appropriate fields without causing runtime errors.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced OpenID Connect authentication to support a broader range of identity providers. Email and name fields are now optional in user profile validation, allowing authentication to proceed even when these fields are missing. Email format validation is preserved when the email field is present.

✏️ Tip: You can customize this high-level summary in your review settings.

The OIDCUserInfoSchema previously required 'email' and 'name'.
This change makes these fields optional to better align with OIDC
provider implementations that may not always return these specific
fields.
@CLAassistant
Copy link

CLAassistant commented Dec 2, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

Walkthrough

The OIDC user info schema validation was relaxed to make email and name fields optional. Previously both fields were required, with email requiring valid format. Now both fields are optional, though email format validation is maintained when present.

Changes

Cohort / File(s) Summary
OIDC Schema Validation
packages/backend/server/src/plugins/oauth/providers/oidc.ts
Made email and name fields optional in OIDC userinfo schema; email retains format validation when provided

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file modification with straightforward schema constraint relaxation
  • No logic changes or control flow modifications
  • Minimal test surface area to consider

Poem

🐰 The schema softens, fields now bend,
Email and name need not attend,
Validation still holds, when present they stay,
More flexibility comes our way! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: making email and name optional in OIDC user info schema, which aligns with the changeset's objective.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hayd1n hayd1n changed the title fix(server): make email and name optional in user info fix(server): make email and name optional in OIDC user info Dec 2, 2025
@darkskygit
Copy link
Member

fixed by #14061

@darkskygit darkskygit closed this Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants