Repository navigation
fix: improve oidc identity mapping and sync developer email - #348
Merged
learnerjohn merged 3 commits intoOct 19, 2026
Merged
Conversation
wzlee
force-pushed
the
fix/oidc-nested-claim-mapping
branch
from
September 28, 2026 09:52
bc5a75c to
75768ed
Compare
Some identity providers wrap user info in an envelope instead of
returning flat OIDC claims. For example, Feishu's authen v1 user_info
API responds with {"code":0,"data":{...},"msg":"success"}, so the flat
Map.get() lookup on identity mapping fields (sub/name by default) never
matches and login fails with "Missing user ID or user name in ID Token"
even though the user info was fetched successfully.
- Add ClaimUtils.resolveClaim: top-level claim keys are matched first
for backward compatibility; otherwise dot-separated fields such as
data.open_id are resolved as nested paths
- Apply it to identity field extraction in OidcServiceImpl and
OAuth2ServiceImpl (userId/userName/email/avatarUrl)
- Add unit tests covering flat claims, nested envelopes, dotted
top-level keys, and invalid paths
With this change, Feishu OIDC login works by configuring the identity
mapping as data.open_id / data.name / data.email / data.avatar_url.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: lizw2 <214508914@qq.com>
wzlee
force-pushed
the
fix/oidc-nested-claim-mapping
branch
from
September 28, 2026 11:08
75768ed to
d1646c1
Compare
- sync email (with avatar) into the existing developer on each OIDC login, so accounts created before the email mapping was configured get backfilled - expose email in DeveloperResult so the portal profile page can display it - clarify the error message when identity mapping yields no user ID or name Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: lizw2 <214508914@qq.com>
wzlee
force-pushed
the
fix/oidc-nested-claim-mapping
branch
from
September 29, 2026 08:00
803d781 to
16209ee
Compare
Signed-off-by: zhaoh <yanyan.zh@alibaba-inc.com>
learnerjohn
self-requested a review
October 19, 2026 06:34
learnerjohn
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Some identity providers wrap user info in an envelope such as Feishu's
{"code":0,"data":{...}}. Flat claim lookup cannot resolve fields such asdata.open_id, causing login to fail. Existing OIDC accounts also retain an empty email after email mapping is configured, and the profile result previously omitted email.ClaimUtils.resolveClaim, while preserving exact top-level claim precedence for keys containing dots.data.,., anddata..open_id, so malformed paths cannot resolve to an entire object or an empty-key claim. Exact top-level keys remain supported.emailinDeveloperResultand clarify the identity mapping error for missing user IDs or names.✅ Type of Change
🧪 Testing
ClaimUtilsTestandDeveloperServiceImplProfileTest: 29 tests pass, covering nested mapping, literal top-level precedence, empty path segments, email backfill, blank-value preservation, unchanged profiles, and missing identities../scripts/code-check.sh backendpasses.main;./mvnw -q verifypasses with 234 tests, zero failures, zero errors, and zero skipped tests.git diff --checkpasses.accounts.feishu.cnauthorize/token endpoints andauthen/v1/user_info, usingdata.open_id/data.name/data.email/data.avatar_url, supports registration, repeated-login email backfill, and portal profile email display.📋 Checklist