made the check on the result from PrivacyIDEA less sensitive for whitespaces being added / removed as this broke the script in PrivacyIDEA 2.1x.
This commit is contained in:
2
privacyidea-checkotp
Executable file → Normal file
2
privacyidea-checkotp
Executable file → Normal file
@@ -49,7 +49,7 @@ fi
|
||||
otpresult=`/usr/bin/curl -s "$URL" --data-urlencode "user=$LOGIN" --data-urlencode "pass=$PASSWORD" --data-urlencode "client=$NAS"`
|
||||
|
||||
# Extract the status of the request from the returned JSON
|
||||
otpstatus=`echo $otpresult | sed 's/^{.*"result": { "status": true, "value": \(.*\) },.*}/\1/'`
|
||||
otpstatus=`echo $otpresult | sed 's/^{.*"result": *{ *"status": *true, *"value": *\(.*\) *},.*}/\1/'`
|
||||
|
||||
if [ "$otpstatus" = "true" ]; then
|
||||
# echo $LOGIN did authenticate $otpresult
|
||||
|
||||
Reference in New Issue
Block a user