Sample .Net Web Application using Context Handler
Document Reference: D.03.08.00010
This guide describes how to configure the sample .Net web application using Context Handler for login.
In the KOMBIT Støttesystemer information model, a web application that authenticates users based on an assertion issued by Context Handler (CH) is referred to as a Brugervendt system. In the following guide the terms Brugervendt system
and web application
will be used interchangeably.
After completing this guide, the .Net-based sample web application will be configured and ready to be used.
It is assumed that the reader is a .Net-developer knowledgeable in the technologies used to develop this .Net-based sample, including:
- C#
- Microsoft.Net framework v4.5
- Microsoft Windows Server Operating System
- Microsoft Internet Information Systems (IIS)
- HTTP and HTTPS
- X509v3 Certificates
The .Net sample web application is based on the open source project OIOSAML.Net
The WebsiteDemo in OIOSAML.Net is used to demonstrate how to send a SAML2.0 AuthRequest, how to receive, and how to process a SAML2.0 response containing a SAML2.0 assertion.
This guide explains how to configure the sample web application (websitedemo) based on a SAML2.0 metadata document from the identity provider with which the sample web application will be used. In this sample, the identity provider is the Context Handler
.
In this guide the metadata-file for the KOMBIT Støttesystemer Context Handler in the project environment is used.
To use this sample do the following:
- Unpack the provided zip-file
kombit-web-net.zip
toC:\kombit-web-net
. - Open
C:\kombit-web-net\Kombit.Samples.CH.WebsiteDemo.sln
in Visual Studio, and build the solution. - Make sure an SSL certificate that covers the DNS name
claimapp.projekt-stoettesystemerne.dk
is present inLocalMachine\My
certificate store. - Open the Hosts-file, and map the DNS name
claimapp.projekt-stoettesystemerne.dk
to localhost. - Create a new IIS web application:
- The
Site name
should beclaimapp.projekt-stoettesystemerne.dk
- The
Physical path
should beC:\kombit-web-net\Kombit.Samples.CH.WebsiteDemo
- The
Binding type
should beHTTPS
- The
Host name
should beclaimapp.projekt-stoettesystemerne.dk
- Select an appropriate SSL certificate, that matches the host name chosen in the previous step
- The
- Grant the application pool identity for the web application read and execute permissions to
C:\kombit-web-net
- Import the certificate
C:\kombit-web-net\Certificates\saml.claimapp.projekt-stoettesystemerne.dk.p12
toLocalMachine\My
. - Assign the application pool identity for the web application read permissions to the private key for the certificate imported in the previous step.
- Open a browser and point it to https://claimapp.projekt-stoettesystemerne.dk
- Click the Go to My Page to login using the Context Handler.