Skip to content

Jans Admin UI Developers setup Guide

Arnab Dutta edited this page Jun 27, 2022 · 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. Set JETTY_HOME environment varaible with value /path/to/jetty-home
  2. Create directory /path/to/jetty-home/jans-config-api. This will be called as $JETTY_BASE.
  3. cd $JETTY_BASE
  4. 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

Note: Rather than following step 1 and 2 you can directly download war from https://jenkins.jans.io/maven/io/jans/jans-config-api-server/1.0.0-SNAPSHOT/jans-config-api-server-1.0.0-SNAPSHOT.war and rename it to jans-config-api.war.

  1. Clone Jans Config Api using the below command.
git clone https://github.com/JanssenProject/jans-config-api.git
  1. Change the directory to the cloned Jans Config Api project. Edit jans-config-api\server\src\main\resources\log4j2.xml to set path of generated log files. Built the project by skipping the test cases.
cd jans-config-api
mvn clean install -Dmaven.test.skip=true
  1. Download jetty server 11.

  2. Now copy jans-config-api\server\target\jans-config-api.war to webapps directory of jetty_base ($JETTY_BASE/webapps).

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

  4. Copy admin-ui plugin jar from jans-config-api\plugins\admin-ui-plugin\target\admin-ui-plugin-distribution.jar to $JETTY_BASE/custom/libs. Note: admin-ui-plugin-distribution.jar can be downloaded from https://jenkins.jans.io/maven/io/jans/jans-config-api/plugins/admin-ui-plugin/1.0.0-SNAPSHOT/admin-ui-plugin-1.0.0-SNAPSHOT-distribution.jar (and rename to admin-ui-plugin-distribution.jar).

  5. Create $JETTY_BASE/custom/config/auiConfiguration.properties with following contents.

authserver.clientId=2000.6da7face-b696-4016-af17-422381c3fc2e
authserver.clientSecret=A8TSkhKGjxox
authserver.authzBaseUrl=https://admin-ui-test.gluu.org/jans-auth/restv1/authorize
authserver.scope=openid+profile+email+user_name
authserver.acrValues=basic
authserver.redirectUrl=http://localhost:4100
authserver.frontChannelLogoutUrl=http://localhost:4100/logout
authserver.postLogoutRedirectUri=http://localhost:4100
authserver.tokenEndpoint=https://admin-ui-test.gluu.org/jans-auth/restv1/token
authserver.introspectionEndpoint=https://admin-ui-test.gluu.org/jans-auth/restv1/introspection
authserver.userInfoEndpoint=https://admin-ui-test.gluu.org/jans-auth/restv1/userinfo
authserver.endSessionEndpoint=https://admin-ui-test.gluu.org/jans-auth/restv1/end_session

tokenServer.clientId=2000.6da7face-b696-4016-af17-422381c3fc2e
tokenServer.clientSecret=A8TSkhKGjxox
tokenServer.authzBaseUrl=https://admin-ui-test.gluu.org/jans-auth/restv1/authorize
tokenServer.scope=openid+profile+email+user_name
tokenServer.acrValues=basic
tokenServer.redirectUrl=https://admin-ui-test.gluu.org/admin
tokenServer.logoutUrl=https://admin-ui-test.gluu.org/admin
tokenServer.tokenEndpoint=https://admin-ui-test.gluu.org/jans-auth/restv1/token
tokenServer.introspectionEndpoint=https://admin-ui-test.gluu.org/jans-auth/restv1/introspection
tokenServer.userInfoEndpoint=https://admin-ui-test.gluu.org/jans-auth/restv1/userinfo

  1. Create $JETTY_BASE/webapps/jans-config-api.xml. Set absolute path of admin-ui-plugin-distribution.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</Set>

</Configure>
  1. 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 of $JETTY_BASE/custom/config/conf/jans-ldap.properties.

  2. 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

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 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