Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions connector/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,13 @@ func (c *ldapConnector) identityFromEntry(user ldap.Entry) (ident connector.Iden
missing = append(missing, c.UserSearch.PreferredUsernameAttrAttr)
}
}

// TODO(ericchiang): Let this value be set from an attribute.
ident.EmailVerified = false
if c.UserSearch.EmailSuffix != "" {
ident.Email = ident.Username + "@" + c.UserSearch.EmailSuffix
} else if ident.Email = getAttr(user, c.UserSearch.EmailAttr); ident.Email == "" {
} else if ident.Email = getAttr(user, c.UserSearch.EmailAttr); ident.Email == "" && ident.EmailVerified {
missing = append(missing, c.UserSearch.EmailAttr)
}
// TODO(ericchiang): Let this value be set from an attribute.
ident.EmailVerified = true

if len(missing) != 0 {
err := fmt.Errorf("ldap: entry %q missing following required attribute(s): %q", user.DN, missing)
Expand Down