set ldap auth

This commit is contained in:
2019-11-28 10:21:17 +01:00
parent 62a91653c3
commit d53fd64121
6 changed files with 16 additions and 12 deletions

View File

@ -11,7 +11,7 @@ import (
// LogIn auth the client
func LogIn(username string, password string) (ok bool, user map[string]string) {
var configFile = "../server.conf"
var configFile = "server.conf"
var conf *config.Config
var conferr error
conf, conferr = config.NewFromFile(configFile)
@ -30,6 +30,7 @@ func LogIn(username string, password string) (ok bool, user map[string]string) {
GroupFilter: "(memberUid=%s)",
Attributes: conf.LDAP.Attributes,
}
log.Print(ldapclient)
defer ldapclient.Close()
ok, user, err := ldapclient.Authenticate(username, password)