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