Skip to content

A simple but configurable shell script to authenticate against LDAP

License

Notifications You must be signed in to change notification settings

flighter18/ldap-auth-sh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A Simple Shell Script to Authenticate Against LDAP

This is a simple but extensible shell script to authenticate users by binding to LDAP. Additional checks, such as requiring group memberships, can easily be configured. The credentials are read from environment variables. In case of a successful authentication, it exits with exit code 0, non-zero otherwise.

ldap-auth-sh is known to work with:

  • OpenVPN (via the --auth-user-pass-verify option)
  • Home Assistant (via the upcoming command_line auth provider)

However, it's of course not limited to these platforms.

Requirements

You need:

  • a POSIX-compliant shell with cat, grep and sed (even BusyBox will do)
  • a compatible LDAP client, currently one of
    • curl (with ldap protocol support compiled in, verify with curl --version)
    • ldapsearch

Getting Started

Just copy the file ldap-auth.sh and read the comments therein.

Sample configurations are shipped in the examples directory.

About

A simple but configurable shell script to authenticate against LDAP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%