Repository navigation
Conversation
OIDC relying parties build a user's first and last name from the standard profile claims. SimpleAuth only sent `name`, so clients put the whole display name into the first name and asked for a last name. OpenProject, for example, creates "John Doe Doe" after prompting every new user for a last name on first login. Directory users now carry the AD givenName and sn: - LDAP config gains given_name_attr / family_name_attr. Left empty they default to givenName / sn at runtime, so configurations saved before this change pick the names up without reconfiguration. Both auto-configuration paths set them explicitly. - The user record stores given_name / family_name (JSON in both stores, no migration). They are set at JIT provisioning (password, Kerberos and admin import) and refreshed by syncUserFromLDAP on every login, like the other directory attributes. - The ID token, the access token (login, refresh and OIDC paths) and OIDC /userinfo carry given_name / family_name when known; they are omitted otherwise. Discovery lists both in claims_supported. - The admin LDAP test-user preview shows the mapped values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
OIDC relying parties build a user's first and last name from the standard profile claims
given_nameandfamily_name. SimpleAuth only sendsname, so clients guess. OpenProject, for example, puts the whole display name into the first name and stops every new user at a registration form to type a last name. The result is accounts like "John Doe Doe".AD already has the data, in
givenNameandsn. This PR carries it through.Change
given_name_attr/family_name_attrare added next to the existing*_attrfields. Left empty, they default togivenName/snat runtime, so configurations saved before this change start emitting the names without reconfiguration. Both auto-configuration paths (discover and AD setup) set them explicitly. Directories without those attributes simply produce no names.given_name/family_nameare JSON fields in both stores, so no migration is needed. They are set at JIT provisioning (password login, Kerberos, admin import) and refreshed bysyncUserFromLDAPon every login, exactly likedepartmentandjob_title. A renamed AD account is picked up at the user's next login./userinfoincludegiven_name/family_namewhen known. They are omitted otherwise, for example for local users, rather than sent empty. Discovery lists both inclaims_supported.test-userpreview shows the mapped values, so an admin can check the mapping.ACTIVE-DIRECTORY.mdattribute table and theAPI.mddiscovery and userinfo examples are updated.The diff adds lines only, apart from the two lists it extends: the LDAP search attribute list and
claims_supported.Verification
Tests:
internal/handler/oidc_profile_names_test.goruns the full authorize → code → token flow. It checks:/userinfo(with an Arabic name);givenName/snand honours an override;syncUserFromLDAPstores and refreshes the names.internal/auth/ldap_names_test.gochecks that the search requests the attributes, that the entry maps toGivenName/FamilyName, and that unmapped attributes produce nothing.Full
go test ./...is green, andgo vetandgofmtare clean.End to end: OpenProject 17.9 using SimpleAuth as its OIDC provider, against a Samba AD DC:
newhire, Kerberos)jdoe)salem)given_name: سالم,family_name: المريNot in this PR
The typed SDK user models (Go, Python, JS, .NET) don't expose the two fields yet. Apps reading raw claims get them now. Adding them to each SDK is a natural follow-up, done separately so each SDK can be built and tested in its own toolchain.
This PR is independent of #72 and #73; all three merge together cleanly.
🤖 Generated with Claude Code