diff --git a/cmd/iam.go b/cmd/iam.go index cb212fea5..cd916895c 100644 --- a/cmd/iam.go +++ b/cmd/iam.go @@ -1358,9 +1358,15 @@ func (sys *IAMSys) updateGroupMembershipsForLDAP(ctx context.Context) { // DN to ldap username mapping for each LDAP user parentUserToLDAPUsernameMap := make(map[string]string) for _, cred := range allCreds { + // Expired credentials don't need parent user updates. + if cred.IsExpired() { + continue + } + if !sys.LDAPConfig.IsLDAPUserDN(cred.ParentUser) { continue } + // Check if this is the first time we are // encountering this LDAP user. if _, ok := parentUserToCredsMap[cred.ParentUser]; !ok { @@ -1425,6 +1431,11 @@ func (sys *IAMSys) updateGroupMembershipsForLDAP(ctx context.Context) { continue } + // Expired credentials don't need group membership updates. + if cred.IsExpired() { + continue + } + cred.Groups = currGroups if err := sys.store.UpdateUserIdentity(ctx, cred); err != nil { // Log and continue error - perhaps it'll work the next time.