Repository navigation
fix: Fix DingTalk department binding for users without an email - #139
Merged
qianmoQ merged 1 commit intoNov 11, 2026
Merged
Conversation
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.
Changelog category
Changelog entry (Details of this change)
and select the shallowest assigned department as the primary department.
Affected version
Background
DingTalk directory synchronization currently binds an OIDC account to an
employee by email. Users without an email can sign in successfully, but their
department memberships are not populated even when a matching DingTalk employee
exists.
The existing primary-department selection also does not consistently reflect
the employee's position in the synchronized organization hierarchy.
Changes
in the synchronized directory snapshot.
event, including the MFA flow.
email, allow a unique trusted phone number to establish the initial employee
binding.
to the DingTalk employee ID, so later phone changes do not automatically
transfer an account to another employee.
to the configured data source.
primary department, with a stable tie-breaker for departments at the same
level. Other local department memberships are retained.
configuration guidance for phone matching.
Phone-based matching relies on the OIDC provider supplying a trusted phone
claim that users cannot change to impersonate another employee. The DingTalk
application must also have access to employee phone numbers.
Validation
login before synchronization, email priority, stable binding, and primary
department selection.
and localization key checks.