ASPX Example

Shibboleth passes several variables relating to the user in the Request.ServerVariables array. The two variables of most use (and used in the example below) are:

  • eppn (a unique identifier, in the form <userID>@ncl.ac.uk)
  • mail (your University email address)

Using Shibboleth headers in an ASPX web form

In the example below, the user will enter form data (in the "<other form fields>" section) and, when the form is submitted, the username and email address of the user logged into Shibboleth will be transmitted - along with the user-entered information - to the page specified in the form's action parameter.

Code:

<%
  dim username=Request.ServerVariables("eppn")
  dim email=Request.ServerVariables("mail")
%> <form action="result.aspx" method="post"> <input type="hidden" name="name" value="<%=username%>" /> <input type="hidden" name="email" value="<%=email%>" /> . . <other input fields> . . <input type="submit" value="Submit" /> </form>