inspect conn
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user