*: improve error handling in ldap outpost, ignore additional errors

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2022-09-23 22:11:47 +02:00
parent 0cc6a24c90
commit 50819ae0f0
6 changed files with 27 additions and 5 deletions

View File

@ -11,6 +11,12 @@ func (pi *ProviderInstance) UserEntry(u api.User) *ldap.Entry {
dn := pi.GetUserDN(u.Username)
attrs := utils.AKAttrsToLDAP(u.Attributes)
if u.IsActive == nil {
u.IsActive = api.PtrBool(false)
}
if u.Email == nil {
u.Email = api.PtrString("")
}
attrs = utils.EnsureAttributes(attrs, map[string][]string{
"memberOf": pi.GroupsForUser(u),
"goauthentik.io/ldap/active": {utils.BoolToString(*u.IsActive)},