Browse Source

Merge branch 'Trekky12-master'

Lauri Ojansivu 5 years ago
parent
commit
be4b2a0504

+ 1 - 0
Dockerfile

@@ -70,6 +70,7 @@ ENV BUILD_DEPS="apt-utils bsdtar gnupg gosu wget curl bzip2 g++ build-essential
     LDAP_CA_CERT="" \
     LDAP_REJECT_UNAUTHORIZED=false \
     LDAP_USER_AUTHENTICATION=false \
+    LDAP_USER_AUTHENTICATION_FIELD=uid \
     LDAP_USER_SEARCH_FILTER="" \
     LDAP_USER_SEARCH_SCOPE="" \
     LDAP_USER_SEARCH_FIELD="" \

+ 3 - 0
docker-compose.yml

@@ -454,6 +454,9 @@ services:
       # Option to login to the LDAP server with the user's own username and password, instead of an administrator key. Default: false (use administrator key).
       #- LDAP_USER_AUTHENTICATION="true"
       #
+      # Which field is used to find the user for the user authentication. Default: uid.
+      #- LDAP_USER_AUTHENTICATION_FIELD="uid"
+      #
       # Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed
       #- LDAP_USER_SEARCH_FILTER=
       #

+ 2 - 1
packages/wekan-ldap/server/ldap.js

@@ -27,6 +27,7 @@ export default class LDAP {
       BaseDN                             : this.constructor.settings_get('LDAP_BASEDN'),
       Internal_Log_Level                 : this.constructor.settings_get('INTERNAL_LOG_LEVEL'),
       User_Authentication                : this.constructor.settings_get('LDAP_USER_AUTHENTICATION'),
+      User_Authentication_Field          : this.constructor.settings_get('LDAP_USER_AUTHENTICATION_FIELD'),
       User_Attributes                    : this.constructor.settings_get('LDAP_USER_ATTRIBUTES'),
       User_Search_Filter                 : this.constructor.settings_get('LDAP_USER_SEARCH_FILTER'),
       User_Search_Scope                  : this.constructor.settings_get('LDAP_USER_SEARCH_SCOPE'),
@@ -226,7 +227,7 @@ export default class LDAP {
 
     if (!this.options.BaseDN) throw new Error('BaseDN is not provided');
 
-    const userDn = `uid=${username},${this.options.BaseDN}`;
+    const userDn = `${this.options.User_Authentication_Field}=${username},${this.options.BaseDN}`;
 
     this.bindSync(userDn, password);
     this.domainBinded = true;

+ 2 - 0
releases/virtualbox/start-wekan.sh

@@ -245,6 +245,8 @@
         #export LDAP_REJECT_UNAUTHORIZED=false
         # Option to login to the LDAP server with the user's own username and password, instead of an administrator key. Default: false (use administrator key).
         #export LDAP_USER_AUTHENTICATION=true
+        # Which field is used to find the user for the user authentication. Default: uid.
+        #export LDAP_USER_AUTHENTICATION_FIELD=uid
         # LDAP_USER_SEARCH_FILTER : Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed
         # example :  export LDAP_USER_SEARCH_FILTER=
         #export LDAP_USER_SEARCH_FILTER=

File diff suppressed because it is too large
+ 0 - 0
snap-src/bin/config


+ 3 - 0
snap-src/bin/wekan-help

@@ -306,6 +306,9 @@ echo -e "\n"
 echo -e "Option to login to the LDAP server with the user's own username and password, instead of an administrator key. Default: false (use administrator key)."
 echo -e "\t$ snap set $SNAP_NAME ldap-user-authentication='true'"
 echo -e "\n"
+echo -e "Which field is used to find the user for the user authentication. Default: uid."
+echo -e "\t$ snap set $SNAP_NAME ldap-user-authentication-field='uid'"
+echo -e "\n"
 echo -e "Ldap User Search Filter."
 echo -e "Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed:"
 echo -e "\t$ snap set $SNAP_NAME ldap-user-search-filter=''"

+ 3 - 0
start-wekan.bat

@@ -244,6 +244,9 @@ REM SET LDAP_REJECT_UNAUTHORIZED=false
 REM # Option to login to the LDAP server with the user's own username and password, instead of an administrator key. Default: false (use administrator key).
 REM SET LDAP_USER_AUTHENTICATION=true
 
+REM # Which field is used to find the user for the user authentication. Default: uid.
+REM SET LDAP_USER_AUTHENTICATION_FIELD=uid
+
 REM # LDAP_USER_SEARCH_FILTER : Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed
 REM # example : LDAP_USER_SEARCH_FILTER=
 REM SET LDAP_USER_SEARCH_FILTER=

+ 2 - 0
start-wekan.sh

@@ -247,6 +247,8 @@
       #export LDAP_REJECT_UNAUTHORIZED=false
       # Option to login to the LDAP server with the user's own username and password, instead of an administrator key. Default: false (use administrator key).
       #export LDAP_USER_AUTHENTICATION=true
+      # Which field is used to find the user for the user authentication. Default: uid.
+      #export LDAP_USER_AUTHENTICATION_FIELD=uid
       # LDAP_USER_SEARCH_FILTER : Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed
       # example :  export LDAP_USER_SEARCH_FILTER=
       #export LDAP_USER_SEARCH_FILTER=

Some files were not shown because too many files changed in this diff