thomiceli / opengist

Self-hosted pastebin powered by Git, open-source alternative to Github Gist.
https://opengist.io
GNU Affero General Public License v3.0
1.9k stars 100 forks source link

Introduce basic LDAP authentication. #385

Open fraggerfox opened 1 week ago

fraggerfox commented 1 week ago

Introduce basic LDAP authentication.

This PR introduces basic LDAP authentication and the necessary bits to configure it.

LDAP is now provided as a site wide configuration option in the admin panel. image

When this option is enabled.

The configuration details are shown at the bottom on the configuration section of admin panel. image

LDAP authentication and local account password sync (Successful login) image

Failed LDAP and local authentication (Failed login) image

Local authentication when LDAP is unavailable (Successful login) image

Local authentication if the user is not present in LDAP (Successful login) image

Partially Addresses #77, the changes were implemented based on a LDAP set up I use in my personal infrastructure. So not all configuration options may be present in this implementation.

The LDAP implementation is done using https://github.com/go-ldap/ldap