inspect conn

This commit is contained in:
mr
2026-02-04 10:59:01 +01:00
parent 5512cc76c3
commit 64b8da67f2

View File

@@ -86,7 +86,6 @@ func (cli *Client) Authenticate(ctx context.Context, username string, password s
if username == "" || password == "" {
return false, nil
}
var cancel context.CancelFunc
ctx, cancel = context.WithCancel(ctx)
fmt.Println("Connect", ctx, username, password)
@@ -102,9 +101,12 @@ func (cli *Client) Authenticate(ctx context.Context, username string, password s
if err != nil || details == nil {
return false, err
}
fmt.Println(details)
a := details["dn"]
fmt.Println(a)
log.Println("Binding DN:", a[0], "with password:", password)
if err := cn.Bind(a[0], password); err != nil {
fmt.Println(err)
if err == errInvalidCredentials {
return false, nil
}