forked from fedushare/mech_saml_ec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestclient.sh
executable file
·44 lines (37 loc) · 1.45 KB
/
testclient.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
host='localhost'
port=3490
# NOTE: ProtectNetwork currently doesn't understand ChannelBindings so it will
# fail the request with HTTP 500.
idp='https://idp.protectnetwork.org/protectnetwork-idp/profile/SAML2/SOAP/ECP'
#idp='https://boingo.ncsa.uiuc.edu/idp/profile/SAML2/SOAP/ECP'
user_cert="$SAML_EC_USER_CERT"
user_key="$SAML_EC_USER_KEY"
# If username and password passed via command line, ignore user cert/key
if [ $# -eq 2 ] ; then
user_cert=''
user_key=''
fi
# If user cert/key is not specified, prompt for missing username/password
if [ ! -s "$user_cert" ] || [ ! -s "$user_key"] ; then
if [ $# -lt 1 ] ; then
read -p "Enter Username: " username
else
username=$1
fi
if [ $# -lt 2 ] ; then
read -s -p "Enter Password: " password
echo
else
password=$2
fi
else
# If using user cert/key with boingo, append 'SSL' to idp url
if [ $idp == "https://boingo.ncsa.uiuc.edu/idp/profile/SAML2/SOAP/ECP" ] ; then
idp = "$idp""SSL"
fi
fi
if [ $idp == "https://idp.protectnetwork.org/protectnetwork-idp/profile/SAML2/SOAP/ECP" ] ; then
echo "NOTE: ProtectNetwork may not understand ChannelBindings so it might fail the request with HTTP 500."
fi
SAML_EC_IDP="$idp" SAML_EC_USER_CERT="$user_cert" SAML_EC_USER_KEY="$user_key" gss-sample/gss-client -nw -nx -nm -port $port -user "$username" -pass "$password" -mech "{ 1 3 6 1 4 1 11591 4 6 }" $host "host@`hostname`" testmessage