0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-04 14:01:10 +00:00
nextcloud_server/apps/files_external/tests/sso-setup/test-sso-smb.sh
Robin Appelman 0492bf5644
fix successfull authentication detection
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-02-02 16:38:56 +01:00

25 lines
798 B
Bash
Executable file

#!/usr/bin/env bash
set -e
DC_IP="$1"
SCRIPT_DIR="${0%/*}"
echo -n "Checking that we can authenticate using kerberos: "
LOGIN_CONTENT=$("$SCRIPT_DIR/client-cmd.sh" $DC_IP curl -i -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/index.php/apps/user_saml/saml/login?originalUrl=http://localhost/success)
if [[ "$LOGIN_CONTENT" =~ "Location: http://localhost/success" ]]; then
echo "✔️"
else
echo "❌"
exit 1
fi
echo -n "Getting test file: "
CONTENT=$("$SCRIPT_DIR/client-cmd.sh" $DC_IP curl -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/remote.php/webdav/smb/test.txt)
CONTENT=$(echo $CONTENT | head -n 1 | tr -d '[:space:]')
if [[ $CONTENT == "testfile" ]]; then
echo "✔️"
else
echo "❌"
exit 1
fi