Skip to content

Jans Admin UI Developers setup Guide

Arnab Dutta edited this page Mar 13, 2023 · 23 revisions

Backend Setup

Prerequisites

  1. JDK 11
  2. Maven 3+
  3. Git
  4. Jetty server 11(https://www.eclipse.org/jetty/)

Jetty 11 Configuation

  1. Download jetty server 11.
  2. Set JETTY_HOME environment varaible with value /path/to/jetty-home
  3. Create directory /path/to/jetty-home/jans-config-api. This will be called as $JETTY_BASE.
  4. cd $JETTY_BASE
  5. Execute following command java -jar $JETTY_HOME/start.jar --add-module=server,deploy,annotations,resources,http,http-forwarded,threadpool,console-capture,jsp,websocket

The last command creates a $JETTY_BASE/start.d/ directory and other directories that contain the configuration of the server, including the $JETTY_BASE/webapps/ directory, in which standard *.war files can be deployed.

Installation Steps

  1. Take access to https://jenkins.jans.io/ (contact @ganesh-at-wiw on Rocket Chat to get access). Log in to https://jenkins.jans.io/ and go to project jans-config-api .

  2. Open Build with Parameters menu. Enter admin-ui-development-branch VERSION_NAME and select MAVEN_SKIP_TESTS checkbox. Click on Build button. image

  3. Download https://jenkins.jans.io/maven/io/jans/jans-config-api-server/<latest_version>/jans-config-api-server-.war to webapps directory of jetty_base ($JETTY_BASE/webapps). Remane war to jans-config-api.war.

  4. Create $JETTY_BASE/custom/libs and $JETTY_BASE/custom/config directories.

  5. Copy admin-ui plugin jar from https://jenkins.jans.io/maven/io/jans/jans-config-api/plugins/admin-ui-plugin/<latest_version>/admin-ui-plugin-<version>-distribution.jar to $JETTY_BASE/custom/libs. Rename jar to admin-ui-plugin.jar

  6. Create $JETTY_BASE/webapps/jans-config-api.xml. Set absolute path of admin-ui-plugin-distribution.jar and user-mgt-plugin.jar in extraClasspath tag.

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
      <Set name="contextPath">/jans-config-api</Set>
      <Set name="war">
              <Property name="jetty.webapps" default="." />/jans-config-api.war
      </Set>
      <Set name="extractWAR">true</Set>

      <Set name="extraClasspath"><path_to_jetty_base_folder>/custom/libs/admin-ui-plugin-distribution.jar,<path_to_jetty_base_folder>/custom/libs/user-mgt-plugin.jar</Set>

</Configure>
  1. Get ssh access to admin-ui-test.gluu.org server (contact @ganesh-at-wiw on Rocket Chat to get access).

  2. Download /etc/jans/conf/jans.properties, /etc/jans/conf/jans-ldap.properties, /etc/jans/conf/salt and /etc/certs/opendj.p12 from admin-ui-test.gluu.org server to $JETTY_BASE/custom/config/conf folder locally. Set ssl.trustStoreFile=<path_to_jetty_base_folder>/custom/config/conf/opendj.pkcs12 value in $JETTY_BASE/custom/config/conf/jans-ldap.properties.

  3. Tunnel admin-ui-test.gluu.org database.

ssh -L 1636:localhost:1636 -C -N -l root admin-ui-test.gluu.org -p 22222
  1. Change directory to $JETTY_BASE folder and start the jetty server using the below command. Check http://localhost:8080/jans-config-api/admin-ui/oauth2/config.
java -jar $JETTY_HOME/start.jar -Djans.base=<path_to_jetty_base_folder>/custom/config
  1. See if the server starts successfully without error on the logs file ($JETTY_BASE/logs/<latest_date>.jetty.log).

Frontend Setup

Prerequisites

  1. Node (14.x)
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt -y install nodejs

Installation Steps

  1. Clone the Gluu flex project using the below command.
https://github.com/GluuFederation/flex
  1. Change the directory to the admin-ui directory of cloned flex project and execute the below commands.
cd admin-ui
rm -rf jans_config_api
npm install @openapitools/openapi-generator-cli -g
npm install openapi-merge-cli
npm run api
npm install

npm run start
  1. Once the project is compiled and started, UI can be accessed at URL: http://localhost:4100

  2. Use the below credentials to login to UI.

username: admin

password: Gluu1234.

Clone this wiki locally