Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nerney/dappy
Basic LDAP Authenticator for Go 🔓🔑
https://github.com/nerney/dappy
active-directory authentication go golang ldap ldap-authentication login
Last synced: 3 months ago
JSON representation
Basic LDAP Authenticator for Go 🔓🔑
- Host: GitHub
- URL: https://github.com/nerney/dappy
- Owner: nerney
- License: mit
- Created: 2018-07-05T14:50:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-31T08:11:29.000Z (over 4 years ago)
- Last Synced: 2024-06-20T03:36:49.517Z (5 months ago)
- Topics: active-directory, authentication, go, golang, ldap, ldap-authentication, login
- Language: Go
- Homepage:
- Size: 157 KB
- Stars: 58
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Basic LDAP client for Go
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/nerney/dappy)
[![Report Card](https://goreportcard.com/badge/github.com/nerney/dappy)](https://goreportcard.com/report/github.com/nerney/dappy)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:
```go
package mainimport (
"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!")
}
}```