September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
26
Task/Active-Directory-Connect/Go/active-directory-connect.go
Normal file
26
Task/Active-Directory-Connect/Go/active-directory-connect.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"github.com/jtblin/go-ldap-client"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := &ldap.LDAPClient{
|
||||
Base: "dc=example,dc=com",
|
||||
Host: "ldap.example.com",
|
||||
Port: 389,
|
||||
UseSSL: false,
|
||||
BindDN: "uid=readonlyuser,ou=People,dc=example,dc=com",
|
||||
BindPassword: "readonlypassword",
|
||||
UserFilter: "(uid=%s)",
|
||||
GroupFilter: "(memberUid=%s)",
|
||||
Attributes: []string{"givenName", "sn", "mail", "uid"},
|
||||
}
|
||||
defer client.Close()
|
||||
err := client.Connect()
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect : %+v", err)
|
||||
}
|
||||
// Do something
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue