working prototype

can push OTP request
can push routes
This commit is contained in:
Xavier Henner
2019-07-09 23:37:37 +02:00
parent f975a19f65
commit 274e824630
8 changed files with 205 additions and 96 deletions

10
ldap.go
View File

@@ -21,11 +21,12 @@ type ldapConfig struct {
primaryAttribute string
secondaryAttribute string
validGroups []string
otpType string
mfaType string
certAuth string
ipMin net.IP
ipMax net.IP
upgradeFrom string
routes []string
}
func (l *ldapConfig) addIPRange(s string) error {
@@ -69,11 +70,12 @@ func (conf *ldapConfig) Auth(logins []string, pass string) (e error, userOk, pas
}
}
if len(logins) != 1 {
return errors.New("invalid login"), false, false, nil
// no server ldap or multiple login should not happen here
if len(logins) != 1 || len(conf.servers) == 0 {
return nil, false, false, nil
}
attributes = logins
attributes = logins
for _, s := range conf.servers {
// we force ldaps because we can
l, err := myDialTLS("tcp", s+":636", &tls.Config{ServerName: s})