Skip to content
Snippets Groups Projects
Verified Commit 183a310f authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: ldap_authentication.sh common name case-insensitive

parent f8bac43c
No related branches found
No related tags found
1 merge request!60FIX: ldap_authentication.sh
Pipeline #22158 passed
...@@ -38,7 +38,10 @@ WHO_AM_I_PATTERN="${WHO_AM_I_PATTERN:-"dn:cn=\${USER_NAME},\${USER_BASE}"}" ...@@ -38,7 +38,10 @@ WHO_AM_I_PATTERN="${WHO_AM_I_PATTERN:-"dn:cn=\${USER_NAME},\${USER_BASE}"}"
# If the second argument is empty or "-", take password from stdin, else use the argument as a file. # If the second argument is empty or "-", take password from stdin, else use the argument as a file.
testpw() { testpw() {
local USER_NAME bind_dn who_am_i pwfile pwargs result local USER_NAME bind_dn who_am_i pwfile pwargs result
USER_NAME="$1"
# cn is case-insensitive https://ldapwiki.com/wiki/Distinguished%20Name%20Case%20Sensitivity
USER_NAME="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
bind_dn="$(eval "echo \"$BIND_DN_PATTERN\"")" bind_dn="$(eval "echo \"$BIND_DN_PATTERN\"")"
who_am_i="$(eval "echo \"$WHO_AM_I_PATTERN\"")" who_am_i="$(eval "echo \"$WHO_AM_I_PATTERN\"")"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment