test
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"oc-auth/conf"
|
||||
"strings"
|
||||
@@ -102,8 +103,9 @@ func (cli *Client) Authenticate(ctx context.Context, username string, password s
|
||||
if details == nil {
|
||||
return false, nil
|
||||
}
|
||||
fmt.Println(details["dn"])
|
||||
if err := cn.Bind(details["dn"][0], password); err != nil {
|
||||
a := details["dn"]
|
||||
log.Println("Binding DN:", a[0], "with password:", password)
|
||||
if err := cn.Bind(a[0], password); err != nil {
|
||||
if err == errInvalidCredentials {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user