Sample Java Web Application using Context Handler
Document Reference: D.03.08.00001
This guide describes how to configure the sample Java 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 Java-based sample web application will be configured and ready to be used.
It is assumed that the reader is a Java developer knowledgeable in the following technologies used to develop this Java-based sample. This includes:
- JDK 1.7
- Glassfish application server
- HTTP and HTTPS
- X509v3 Certificates
The Java-based sample web application is based on the open source project OIOSAML.Java
The demo web site in OIOSAML.Java is used to demonstrate how to send a SAML2.0 AuthRequest, how to receive and 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.
This following prerequisites are needed:
- Windows Server 2012R2
- JDK 7
- NetBeans 8, installed with Glassfish and Metro framework
- Unlimited Strength Cryptography file downloaded from Oracle and installed.
- Glassfish configured with HTTPS. In this guide, it is assumed that the hostname of the Glassfish instance is
claimapp.projekt-stoettesystemerne.dk
, and that Glassfish is listening on SSL on port8181
.
To use this sample do the following:
- Unpack the provided zip-file
kombit-web-java.zip
toC:\kombit-web-java
. - Copy
C:\kombit-web-java\Kombit.Samples.CH.WebsiteDemo\oiosaml-config
toC:\oiosaml-config
- Build the Netbeans project in
C:\kombit-web-java\
- Copy the folder
C:\kombit-web-java\Kombit.Samples.CH.WebsiteDemo
to the autodeploy folder of Glassfish (e.g.C:\Program Files\glassfish-4.1\glassfish\domains\domain1\autodeploy
) - Since the Glassfish server is running , it automatically deploys the website to
C:\Program Files\glassfish-4.1\glassfish\domains\domain1\applications\Kombit.Samples.CH.WebsiteDemo
- Open a browser and point it to https://claimapp.projekt-stoettesystemerne.dk:8181/
- Click the Page requiring Login to login using the Context Handler.