Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Basic LDAP client for Go

GoDoc Report Card

LDAP is complicated. Many times, all you really need to do is authenticate users with it. This package boils down LDAP functionality to User Authentication, that's it.

Thanks to https://github.com/go-ldap/ldap

go get github.com/nerney/dappy

Example:

package main

import (
	"log"

	"github.com/nerney/dappy"
)

func main() {
	var client dappy.Client
	var err error

	// create a new client
	if client, err = dappy.New(dappy.Config{
		BaseDN: "dc=example,dc=com",
		Filter: "uid",
		ROUser: dappy.User{Name: "cn=read-only-admin,dc=example,dc=com", Pass: "password"},
		Host:   "ldap.forumsys.com:389",
	}); err != nil {
		panic(err)
	}

	// username and password to authenticate
	username := "tesla"
	password := "password"

	// attempt the authentication
	if err := client.Auth(username, password); err != nil {
		panic(err)
	} else {
		log.Println("Success!")
	}
}

About

Basic LDAP Authenticator for Go πŸ”“πŸ”‘

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.