From 5409a3854999618ba2df026b78f6777aa7267d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Franke?= Date: Tue, 10 Jan 2023 12:48:26 +0100 Subject: [PATCH] Support givenName graph attribute. This sets the LDAP `givenname` attribute when the libe-graph `givenName` attribute exists. Fixes #5210 --- services/graph/pkg/identity/ldap.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/graph/pkg/identity/ldap.go b/services/graph/pkg/identity/ldap.go index 48c6238f4a..b316c08fb5 100644 --- a/services/graph/pkg/identity/ldap.go +++ b/services/graph/pkg/identity/ldap.go @@ -993,6 +993,11 @@ func (i *LDAP) userToLDAPAttrValues(user libregraph.User) (map[string][]string, } attrs["sn"] = []string{sn} + // When we get a givenName, we set the attribute. + if user.GivenName != nil && *user.GivenName != "" { + attrs["givenname"] = []string{*user.GivenName} + } + if !i.usePwModifyExOp && user.PasswordProfile != nil && user.PasswordProfile.Password != nil { // Depending on the LDAP server implementation this might cause the // password to be stored in cleartext in the LDAP database. Using the