This commit is contained in:
mr
2026-01-23 09:49:46 +01:00
parent 9d0b720231
commit 403deaf65b

View File

@@ -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
}