I am writing a bash script that needs ldap authenticate to do the next steps. However, I have not found a tool that can auth ldap and return whether the username and password are true. Is there a existing program that can help me do this?
The script is like
read USERNAME read -s PASSWD LDAP_AUTH_RESULT="$(<ldapauth> <USERNAME> <PASSWD/prompt-passwd>)" if [[ $LDAP_AUTH_RESULT == "$SUCCESS_FLAG" ]]; then <things to do> fi