Skip to content

Developing for Janssen Project#

Remote Debugging#

Janssen Server modules run as a Java process. Hence, like any other Java process the module JVMs can be configured to open a debug port where a remote debugger can be attached. The steps below will show how to configure auth-server module for remote debugging.

  1. Pass the command-line options to the JVM

On the Janssen Server host, open the service config file /etc/default/jans-auth and add the following JVM parameters to as JAVA_OPTIONS


This will open port 6001 for the remote debugger. Any other port can also be used based on availability.

  1. Restart jans-auth services

    systemctl restart jans-auth.service
  2. Check if the port is open and accessible from within the Janssen Server host

Use the jdb tool from JDK to test if the JVM port has been opened

./<path-to-JDK>/bin/jdb -attach 6001

if the port is open, it'll give you output like the below:

Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...

press ctrl+c to come out of it.

  1. Ensure that the port is accessible from outside the host VM as well and firewalls are configured accordingly

  2. Connect to the remote port on the Janssen Server host from the Janssen workspace. Use any IDE (Intellij, Eclipse, etc.) to create and run a remote debugging profile providing IP and debug port of the Janssen Server host.

For IntelliJIdea, create a debug configuration as below:

Run Integration Tests with a Janssen Server VM#

In this guide, we will look at steps to run the Janssen integration test suite against a locally installed Janssen server on the developer machine.

Component Setup#

Component Diagram

Install Janssen Server#

Install the Janssen server using one of the methods described in this guide. Make a note of the host name that you assign to the Janssen server during the installation. For this guide, the Janssen host name would be

Now access the .well-known end-points (sample below) of the Janssen server from the browser to ascertain that the Janssen server running inside local VM is healthy and also accessible from the developer's machine.

Response received should be JSON formatted Janssen configuration details, similar to those below.

"request_parameter_supported" : true,
"pushed_authorization_request_endpoint" : "",
"introspection_endpoint" : "",
"claims_parameter_supported" : false,
"issuer" : "",
"userinfo_encryption_enc_values_supported" : [ "RSA1_5", "RSA-OAEP", "A128KW", "A256KW" ],
"id_token_encryption_enc_values_supported" : [ "A128CBC+HS256", "A256CBC+HS512", "A128GCM", "A256GCM" ],
"authorization_endpoint" : "",
"service_documentation" : "",
"authorization_encryption_alg_values_supported" : [ "RSA1_5", "RSA-OAEP", "A128KW", "A256KW" ],
"id_generation_endpoint" : "",
"claims_supported" : [ "street_address", "country", "zoneinfo", "birthdate", "role", "gender", "user_name", "formatted", "phone_mobile_number", "preferred_username", "inum", "locale", "updated_at", "post_office_box", "nickname", "preferred_language", "email", "website", "email_verified", "profile", "locality", "room_number", "phone_number_verified", "given_name", "middle_name", "picture", "name", "phone_number", "postal_code", "region", "family_name", "jansAdminUIRole" ],
"scope_to_claims_mapping" : [ {
  "user_name" : [ "user_name" ]
}, {
  "" : [ ]
}, {
  "" : [ ]
}, {
  "" : [ ]
}, {
  "" : [ ]
}, {
  "" : [ ]
}, {
  "" : [ ]
}, {
  "" : [ ]
}, {
  "" : [ ]

Configure developer workspace#

We are going to configure the developer workspace in IntelliJIdea IDE. Using IDE, get Janssen server code from Janssen GitHub repository.

Janssen Server is composed of multiple modules. Below are the instructions for configuring each module for tests.

Auth-server client module#

setup certificate#
  • Update Java cacerts

extract certificate for Janssen server with name

openssl s_client -connect 2>&1 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/httpd.crt
this command takes few seconds to return.

Update cacerts of your JRE which is being used by the code workspace. For example, if JRE being used my maven is /usr/lib/jvm/java-11-amazon-corretto. It will prompt for cert store password. The default is changeit.

keytool -import -alias -keystore /usr/lib/jvm/java-11-amazon-corretto/lib/security/cacerts -file /tmp/httpd.crt
Profile setup#

Follow the steps below to configure workspace and run tests for the client module.

  • Under jans-auth-server/client/profile module, make a copy of default profile directory and name the new profile as
  • Under jans-auth-server/client/profile/default directory, Edit file and update the hostname in the value of the following properties:
    •<old-host>:8443 -> (Remember to remove the port)
    • swd.resource=acct:test_user@<old-host>:8443 -> (Remember to remove the port)
  • now at, jans-auth-server/client directory level, run the following maven command
mvn -Dcfg=default -Dcvss-score=9 -Dfindbugs.skip=true -Dlog4j.default.log.level=TRACE -Ddependency.check=false -DskipTests clean install

this will create new artifacts under client/target as per mentioned in profile default

  • Now run client tests by creating intellij run config as below

Last update: 2022-12-05
Created: 2022-05-18