10 SAML10PROT="urn:oasis:names:tc:SAML:1.0:protocol"
11 SAML11PROT="urn:oasis:names:tc:SAML:1.1:protocol"
12 SAML20PROT="urn:oasis:names:tc:SAML:2.0:protocol"
14 SAML20SOAP="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
15 SAML20REDIRECT="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
16 SAML20POST="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
17 SAML20POSTSS="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"
18 SAML20ART="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
19 SAML20PAOS="urn:oasis:names:tc:SAML:2.0:bindings:PAOS"
21 SAML1POST="urn:oasis:names:tc:SAML:1.0:profiles:browser-post"
22 SAML1ART="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"
24 while getopts a:c:e:h:n:o:s:t:12ADLN c
27 c) CERTS[${#CERTS[*]}]=$OPTARG;;
29 h) HOSTS[${#HOSTS[*]}]=$OPTARG;;
30 n) NAKEDHOSTS[${#NAKEDHOSTS[*]}]=$OPTARG;;
32 a) ADMIN[${#ADMIN[*]}]=$OPTARG;;
33 s) SUP[${#SUP[*]}]=$OPTARG;;
34 t) TECH[${#TECH[*]}]=$OPTARG;;
41 \?) echo metagen [-12ADLN] -c cert1 [-c cert2 ...] -h host1 [-h host2 ...] [-e entityID]
46 if [ ${#HOSTS[*]} -eq 0 -a ${#NAKEDHOSTS[*]} -eq 0 ] ; then
47 echo metagen -c cert1 [-c cert2 ...] -h host1 [-h host2 ...] [-e entityID]
51 if [ ${#CERTS[*]} -eq 0 ] ; then
52 CERTS[${#CERTS[*]}]=sp-cert.pem
58 echo Certificate file $c does not exist!
63 if [ -z $ENTITYID ] ; then
64 ENTITYID=https://${HOSTS[0]}/shibboleth
67 # Establish protocols and bindings.
69 if [ $SAML1 -eq 0 -a $SAML2 -eq 0 ] ; then
74 if [ $LOGOUT -eq 1 -o $NAMEIDMGMT -eq 1 ] ; then
76 SLO[${#SLO[*]}]=$SAML20SOAP
77 SLO[${#SLO[*]}]=$SAML20REDIRECT
78 SLO[${#SLO[*]}]=$SAML20POST
79 SLOLOC[${#SLOLOC[*]}]="SOAP"
80 SLOLOC[${#SLOLOC[*]}]="Redirect"
81 SLOLOC[${#SLOLOC[*]}]="POST"
82 if [ $ARTIFACT -eq 1 ] ; then
83 SLO[${#SLO[*]}]=$SAML20ART
84 SLOLOC[${#SLOLOC[*]}]="Artifact"
88 if [ $SAML1 -eq 1 -a $SAML2 -eq 1 ] ; then
89 PROTENUM="$SAML20PROT $SAML11PROT $SAML10PROT"
90 elif [ $SAML1 -eq 1 ] ; then
91 PROTENUM="$SAML11PROT $SAML10PROT"
93 PROTENUM="$SAML20PROT"
96 if [ $SAML2 -eq 1 ] ; then
97 ACS[${#ACS[*]}]=$SAML20POST
98 ACSLOC[${#ACSLOC[*]}]="SAML2/POST"
99 ACS[${#ACS[*]}]=$SAML20POSTSS
100 ACSLOC[${#ACSLOC[*]}]="SAML2/POST-SimpleSign"
101 if [ $ARTIFACT -eq 1 ] ; then
102 ACS[${#ACS[*]}]=$SAML20ART
103 ACSLOC[${#ACSLOC[*]}]="SAML2/Artifact"
105 ACS[${#ACS[*]}]=$SAML20PAOS
106 ACSLOC[${#ACSLOC[*]}]="SAML2/ECP"
109 if [ $SAML1 -eq 1 ] ; then
110 ACS[${#ACS[*]}]=$SAML1POST
111 ACSLOC[${#ACSLOC[*]}]="SAML/POST"
112 if [ $ARTIFACT -eq 1 ] ; then
113 ACS[${#ACS[*]}]=$SAML1ART
114 ACSLOC[${#ACSLOC[*]}]="SAML/Artifact"
118 if [ $SAML2 -eq 1 ] ; then
119 ACS[${#ACS[*]}]=$SAML20PAOS
120 ACSLOC[${#ACSLOC[*]}]="SAML2/ECP"
124 <md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="${ENTITYID}">
125 <md:SPSSODescriptor protocolSupportEnumeration="${PROTENUM}">
129 if [ $DS -eq 1 ] ; then
139 <DiscoveryResponse xmlns="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" Binding="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" Location="https://$h/Shibboleth.sso/DS" index="$count"/>
144 for h in ${NAKEDHOSTS[@]}
147 <DiscoveryResponse xmlns="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" Binding="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" Location="http://$h/Shibboleth.sso/DS" index="$count"/>
163 <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
169 </ds:X509Certificate>
177 if [ $LOGOUT -eq 1 ] ; then
182 while [ $count -lt ${#SLO[*]} ]
185 <md:SingleLogoutService Binding="${SLO[$count]}" Location="https://$h/Shibboleth.sso/SLO/${SLOLOC[$count]}"/>
191 for h in ${NAKEDHOSTS[@]}
194 while [ $count -lt ${#SLO[*]} ]
197 <md:SingleLogoutService Binding="${SLO[$count]}" Location="http://$h/Shibboleth.sso/SLO/${SLOLOC[$count]}"/>
207 if [ $NAMEIDMGMT -eq 1 ] ; then
212 while [ $count -lt ${#SLO[*]} ]
215 <md:ManageNameIDService Binding="${SLO[$count]}" Location="https://$h/Shibboleth.sso/NIM/${SLOLOC[$count]}"/>
221 for h in ${NAKEDHOSTS[@]}
224 while [ $count -lt ${#SLO[*]} ]
227 <md:ManageNameIDService Binding="${SLO[$count]}" Location="http://$h/Shibboleth.sso/NIM/${SLOLOC[$count]}"/>
240 while [ $count -lt ${#ACS[*]} ]
243 <md:AssertionConsumerService Binding="${ACS[$count]}" Location="https://$h/Shibboleth.sso/${ACSLOC[$count]}" index="$((index+1))"/>
250 for h in ${NAKEDHOSTS[@]}
253 while [ $count -lt ${#ACS[*]} ]
256 <md:AssertionConsumerService Binding="${ACS[$count]}" Location="http://$h/Shibboleth.sso/${ACSLOC[$count]}" index="$((index+1))"/>
264 </md:SPSSODescriptor>
267 if [ -n "$ORGNAME" ] ; then
270 <md:OrganizationName xml:lang="en">$ORGNAME</md:OrganizationName>
271 <md:OrganizationDisplayName xml:lang="en">$ORGNAME</md:OrganizationDisplayName>
272 <md:OrganizationURL xml:lang="en">$ENTITYID</md:OrganizationURL>
281 <md:ContactPerson contactType="administrative">
282 <md:GivenName>${c[0]}</md:GivenName>
283 <md:SurName>${c[1]}</md:SurName>
284 <md:EmailAddress>${c[2]}</md:EmailAddress>
293 <md:ContactPerson contactType="support">
294 <md:GivenName>${c[0]}</md:GivenName>
295 <md:SurName>${c[1]}</md:SurName>
296 <md:EmailAddress>${c[2]}</md:EmailAddress>
305 <md:ContactPerson contactType="technical">
306 <md:GivenName>${c[0]}</md:GivenName>
307 <md:SurName>${c[1]}</md:SurName>
308 <md:EmailAddress>${c[2]}</md:EmailAddress>
314 </md:EntityDescriptor>