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" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"log"
"net" "net"
"oc-auth/conf" "oc-auth/conf"
"strings" "strings"
@@ -102,8 +103,9 @@ func (cli *Client) Authenticate(ctx context.Context, username string, password s
if details == nil { if details == nil {
return false, nil return false, nil
} }
fmt.Println(details["dn"]) a := details["dn"]
if err := cn.Bind(details["dn"][0], password); err != nil { log.Println("Binding DN:", a[0], "with password:", password)
if err := cn.Bind(a[0], password); err != nil {
if err == errInvalidCredentials { if err == errInvalidCredentials {
return false, nil return false, nil
} }