This document describes how to setup the provided Java code
(in the directory src/
) in Eclipse.
- Java 1.8
- Eclipse
- Import the project in Eclipse:
- File -> Import -> Maven -> Existing Maven Projects
1. Select the
oidc-java-rp
directory as 'Root Directory' and press Finish.
1. Make sure you're using the Java SE 8 JRE for the project (see [Eclipse settings](http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-choose_config_jre.htm)).
-
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
as a Java application. -
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.).