Skip to content

Commit

Permalink
ldap/bind/memory: do not cache LDAPResultOperationsError goauthentik#…
Browse files Browse the repository at this point in the history
  • Loading branch information
calbrecht committed Jun 14, 2024
1 parent eb685f9 commit fb8ad30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/outpost/ldap/bind/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (sb *SessionBinder) Bind(username string, req *bind.Request) (ldap.LDAPResu
DN: req.BindDN,
Password: req.BindPW,
})
if item != nil {
if item != nil && item.Value() != ldap.LDAPResultOperationsError {
sb.log.WithField("bindDN", req.BindDN).Info("authenticated from session")
return item.Value(), nil
}
Expand All @@ -56,7 +56,7 @@ func (sb *SessionBinder) Bind(username string, req *bind.Request) (ldap.LDAPResu
// Only cache the result if there's been an error
if err == nil {
flag := sb.si.GetFlags(req.BindDN)
if flag == nil || (flag.UserInfo == nil && flag.UserPk == flags.InvalidUserPK) {
if flag == nil || (flag.UserInfo == nil && flag.UserPk == flags.InvalidUserPK) {
sb.log.Error("user flags not set after bind")
return result, err
}
Expand Down

0 comments on commit fb8ad30

Please sign in to comment.