You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

<?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

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}
<!-#printenv->

or

<!--#echo var="HTTP_SHIB_EP_PERSONPRINCIPALNAME" -->


h2. ASP

<table>

<% For Each strKey In Request.ServerVariables %>
<tr>
<td><%= strKey %></td>
<td><%= Request.ServerVariables(strKey) %></td>
</tr>
<% Next %>

</table>

</table>


h2. JSP

<u>HEADERS</u><br />

<table>
<%
java.util.Enumeration eHeaders = request.getHeaderNames();
while(eHeaders.hasMoreElements())

Unknown macro: { String name = (String) eHeaders.nextElement(); Object object = request.getHeader(name); String value = object.toString(); out.println("<tr><td>" + name + "</td><td>" + value + "</td></tr>"); }

%>
</table>


  • No labels