Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix tests for demo/shibboleth
Fix tests for internal SAML.
Add tests for Shibboleth integration.
Slavek Licehammer committed Dec 9, 2020
1 parent 2220e5e commit c3e8ec4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions demo/shibboleth/tests/main.bats
@@ -32,13 +32,13 @@ load ../../../library
check_health_shibboleth_idp
}

@test "040 Check Shibboleth redirection (/midpoint/self/dashboard)" {
curl -k --write-out %{redirect_url} --silen --output /dev/null https://localhost:8443/midpoint/self/dashboard | grep 'https:\/\/localhost:8443\/midpoint\/auth\/gui-default\/mySamlSso\/discovery?idp=https%3A%2F%2Fidptestbed%2Fidp%2Fshibboleth'
@test "040 Check internal SAML redirection (/midpoint/auth/saml-internal)" {
curl -k --write-out %{redirect_url} --silen --output /dev/null https://localhost:8443/midpoint/auth/saml-internal/ | grep 'https:\/\/localhost:8443\/midpoint\/auth\/saml-internal\/mySamlSso\/discovery?idp=https%3A%2F%2Fidptestbed%2Fidp%2Fshibboleth'
}

@test "041 Check Shibboleth redirection action (midpoint/..../discovery?...)" {
@test "041 Check internal SAML redirection action (midpoint/..../discovery?...)" {
TMPFILE=$(mktemp /tmp/samlForm.XXXXXX)
curl -k https://localhost:8443/midpoint/auth/gui-default/mySamlSso/discovery?idp=https://idptestbed/idp/shibboleth >$TMPFILE || (rm $TMPFILE ; return 1)
curl -k https://localhost:8443/midpoint/auth/saml-internal/mySamlSso/discovery?idp=https://idptestbed/idp/shibboleth >$TMPFILE || (rm $TMPFILE ; return 1)
if (grep -q "<input type=\"hidden\" name=\"SAMLRequest\"" <$TMPFILE); then
echo "SAML REQUEST is OK"
rm $TMPFILE
@@ -61,6 +61,14 @@ load ../../../library
[ "$status" -eq 200 ]
}

@test "044 Check Shibboleth redirection (/midpoint/)" {
curl -k --write-out %{redirect_url} --silen --output /dev/null https://localhost:8443/midpoint/ | grep 'https:\/\/localhost:8443\/midpoint\/auth\/shib'
}

@test "045 Check Shibboleth redirection (/midpoint/auth/shib/)" {
curl -k --write-out %{redirect_url} --silen --output /dev/null https://localhost:8443/midpoint/auth/shib/ | grep 'https:\/\/localhost\/idp\/profile\/SAML2\/Redirect\/SSO?SAMLRequest='
}

@test "100 Check internally-authenticated REST call: get 'administrator'" {
check_health
get_and_check_object users 00000000-0000-0000-0000-000000000002 administrator

0 comments on commit c3e8ec4

Please sign in to comment.