Minimum viable NTLM auth implementation

Added env variable "VITE_NTLM_AUTH", if true, login page will attempt NTLM auth challenge instead of showing login page.

If challenge is successful and an authenticate message is received, it will check for the existence of the user using the provided mail attribute, and create an account with a random, complex password, and then authenticate as the user.
This commit is contained in:
Ryan Palmer
2024-09-16 08:32:33 +10:00
parent 9d0331d04f
commit 6ad469a115
9 changed files with 138 additions and 25 deletions

View File

@ -7,14 +7,17 @@ APP_SECRET=REPLACE_WITH_LONG_SECRET
JWT_TOKEN_EXPIRES_IN=30d
# Use NTLM for user authentication
NTLM_AUTH=false
# Use NTLM for user authentication, exposes to browser
VITE_NTLM_AUTH=false
# LDAP settings for NTLM authentication
LDAP_BASEDN=
LDAP_DOMAINSUFFIX=
LDAP_USERNAME=
LDAP_PASSWORD=
# User object attributes for docmost
LDAP_NAMEATTRIBUTE=
LDAP_MAILATTRIBUTE=
DATABASE_URL="postgresql://postgres:password@localhost:5432/docmost?schema=public"
REDIS_URL=redis://127.0.0.1:6379