When using Shibboleth, the IdP returns a SAML assertion to the SP. The following examples simply display the results of the SAML assertion. This gives a very brief introduction which shows how your application might consume the information and use it.
PHP
Code Block |
---|
<?php
<table>
foreach($_SERVER as $key => $value) {
$fkey = '_' . $key;
if (strpos($fkey, 'SHIB') > 0) {
echo '<tr>';
echo "<td>$key</td><td>$value</td>";
echo '</tr>';
}
}
</table>
?>
|
Perl
Code Block |
---|
foreach $var (sort(keys(%ENV))) {
if ($var =~ m/SHIB/ || $var =~ m/REMOTE_USER/) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g; $val =~ s|"|\\"|g;
print "<tr>";
print "<td>${var}</td><td>${val}</td>";
print "</tr>";
}
}
|
SSI - Server Side Includes
Code Block |
---|
<\!\--\#printenv-\->
|
or
Code Block |
---|
<\!--#echo var="HTTP_SHIB_EP_PERSONPRINCIPALNAME" \-->
|
ASP
Code Block |
---|
<table>
<% For Each strKey In Request.ServerVariables %>
<tr>
<td><%= strKey %></td>
<td><%= Request.ServerVariables(strKey) %></td>
</tr>
<% Next %>
</table>
</table>
|
JSP
Code Block |
---|
<u>HEADERS</u><br />
<table>
<%
java.util.Enumeration eHeaders = request.getHeaderNames();
while(eHeaders.hasMoreElements())
{ String name = (String) eHeaders.nextElement(); Object object = request.getHeader(name); String value = object.toString(); out.println("" + name + "" + value + ""); }
%>
</table>
|
Similar samples can be found at Katholieke Universiteit Leuven