Skip to content

Jans Admin UI Developers setup Guide

Arnab Dutta edited this page Apr 19, 2022 · 23 revisions

Backend Setup

Prerequisites

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

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

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

  3. Create $JETTY_HOME/custom/libs and $JETTY_HOME/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_HOME/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_HOME/custom/config/auiConfiguration.properties with following contents.

authserver.clientId=3ef2a2b2-55ec-49cc-aa46-9c15b0ca46d6
authserver.clientSecret=f6b4a057-126f-4e9d-bfcd-f73f9901fff5
authserver.authzBaseUrl=https://admin-ui-test.gluu.org/jans-auth/authorize.htm
authserver.scope=openid+profile+email+user_name
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.healthCheckUrl=https://admin-ui-test.gluu.org/jans-auth/sys/health-check
authserver.endSessionEndpoint=https://admin-ui-test.gluu.org/jans-auth/restv1/end_session
# sbp properties
spring.sbp.runtimeMode = deployment
spring.sbp.enabled = true
spring.sbp.plugins-root = plugins
# remember to add this line in case you are using IDEA
spring.sbp.classes-directories = "out/production/classes, out/production/resources"

tokenServer.clientId=cc5bfca9-45ba-4325-a0ea-26ce2cefdb5a
tokenServer.clientSecret=a3f24171-db68-4fdd-87f6-0f7b7163b235
tokenServer.authzBaseUrl=https://admin-ui-test.gluu.org/jans-auth/authorize.htm
tokenServer.scope=openid+profile+email+user_name
tokenServer.redirectUrl=https://admin-ui-test.gluu.org/admin
tokenServer.logoutUrl=https://admin-ui-test.gluu.org/admin/logout
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

## logging level

logging.level.root=info
logging.level.org.springframework.web=debug


## licenseSpring details

licenseSpring.apiKey=9816ef29-a5fa-4df7-bba7-b7ae83711d28
licenseSpring.productCode=adminui001
licenseSpring.sharedKey=FW4xYR1nFnY6ISWulhMOYSBqx1Li_10D74RznCZxVtQ
licenseSpring.managementKey=raGfAOAy.y9oyJYZaBb8rlM4yfTbNUB7l8InWdE2l
licenseSpring.enabled=true
  1. Create $JETTY_HOME/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_home_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.pkcs12 from admin-ui-test.gluu.org server to $JETTY_HOME/custom/config/conf folder locally. Set ssl.trustStoreFile=<path_to_jetty_home_folder>/custom/config/conf/opendj.pkcs12 value of $JETTY_HOME/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_HOME folder and start the jetty server using the below command. Check http://localhost:8080/jans-config-api/admin-ui/oauth2/config.
java -jar start.jar -Djans.base=<path_to_jetty_home_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