This document describes how to setup the provided Java code
(in the directory java_skeleton/src
) in IntellyJ. You can use Eclipse as well.
- Java 1.8
- IntellyJ Community Edition: https://www.jetbrains.com/idea/download
-
Install java 1.8:
apt-get install openjdk-8-jdk
-
Import the project in IntellyJ:
- Click on the
Import project
option in the welcome window. - Select the
java_skeleton/pom.xml
file and press OK. - Click next on the following windows, and select the installed JDK (located in
/usr/lib/jvm/java-1.8.0-openjdk-amd64
) - Wait for the project to load
- Click on the
-
Test that the project runs:
-
Specify the path to the directory containing all necessary files (
client.json
,index.html
, etc.) inClient::ROOT_PATH
(insrc/oidc_rp/Client.java
). -
Run
WebServer.java
(right-click and Run). -
The application should output something like:
[Thread-0] INFO spark.webserver.SparkServer - == Spark has ignited ... [Thread-0] INFO spark.webserver.SparkServer - >> Listening on 0.0.0.0:8090 [Thread-0] INFO org.eclipse.jetty.server.Server - jetty-9.0.2.v20130417 [Thread-0] INFO org.eclipse.jetty.server.ServerConnector - Started ServerConnector@5967e514{HTTP/1.1}{0.0.0.0:8090}
-
Verify the Relying Party (RP) is running at http://localhost:8090
-
-
Start adding to the skeleton code:
- The missing parts are marked with
TODO
insrc/oidc_rp/Client.java
. - Read the Java Cookbook for more information about how to use the Nimbus OpenID Connect library.
- Make sure to delete cookies and cached data in the browser while testing to avoid strange results (e.g. due to the browser caching redirects, etc.).
- The missing parts are marked with