Skip to content

Admin UI Installation on bank server

duttarnab edited this page Jan 26, 2022 · 3 revisions

bank-op.gluu.org

1. Add introspection script #1 with role:scope mapping.

https://raw.githubusercontent.com/GluuFederation/gluu-admin-ui-api/main/scripts/getScopesFrmUserRoleInterceptionScript.py

2. Create jansAdminUIRole attribute

https://raw.githubusercontent.com/duttarnab/test/master/ldiff/jansAdminUIRole.ldiff

3. Create 4 users with roles

  • api-view
  • api-admin
  • api-manager
  • api-editor

https://raw.githubusercontent.com/duttarnab/test/master/ldiff/api-admin.ldiff https://raw.githubusercontent.com/duttarnab/test/master/ldiff/api-editor.ldiff https://raw.githubusercontent.com/duttarnab/test/master/ldiff/api-manager.ldiff

4. Create Clients

i. OpenID Connect Client used by Admin UI

  • default scopes profile, openid and
  • jansSignedRespAlg = RS256
  • jansAccessTknAsjwt = true

https://raw.githubusercontent.com/duttarnab/test/master/ldiff/auth-client.ldiff

ii. Client Credentials for Admin UI

bank.gluu.org

1. Needed to configure bank.gluu.org

(ADMIN-UI via config-api request and validate access token against bank-op.gluu.org but configures bank.gluu.org.)

a. Trusted issuer for access token (e.g bank-op.gluu.org) in config-api

b. Client creds for Admin UI

Adding admin-ui plugin to jans-config-api

Refer https://github.com/JanssenProject/jans-config-api/wiki/Admin-ui-plugin-deployment-on-server to add admin-ui plugin to jans-config-api.

Setting admin-ui frontend

Configure Apache2

  1. Edit gluu/jans apache configuration file available at path /etc/apache2/sites-available/ (eg: /etc/apache2/sites-available/https_jans.conf) to add the following:
    Alias /admin "<path_of_admin_ui_built_path_deployed_on_apache>"
    <Directory "<path_of_admin_ui_built_path_deployed_on_apache>"
        Options FollowSymLinks Indexes
        DirectoryIndex index.html
        AllowOverride None
        Order allow,deny  
        Allow from all
    </Directory>
  1. Create path_of_admin_ui_built_path_deployed_on_apache (eg: /var/www/html/admin/frontend) .

Built admin-ui frontend

  1. Clone Janssen Admin UI Frontend using the below command.
git clone https://github.com/GluuFederation/gluu-admin-ui
  1. Change the directory to the cloned project and edit .env file.

.env

BASE_PATH=/admin
CONFIG_API_BASE_URL=https://admin-ui-test.gluu.org
API_BASE_URL=https://admin-ui-test.gluu.org/jans-config-api/admin-ui
NPM_TOKEN=
SESSION_TIMEOUT_IN_MINUTES=30

Here,

  • BASE_PATH - If its value is /admin then admin-ui url will be https:///admin
  • API_BASE_URL - admin-ui plugin url
  1. Run the following commands
npm install @openapitools/openapi-generator-cli -g
npm run api
npm install
  1. For creating production built run npm run built:prod. (For creating built for bank.gluu.org run npm run build:bank). This will create admin-ui built in the dist folder of the cloned project.

Deployadmin-ui frontend

  1. Copy the built from dist folder to <path_of_admin_ui_built_path_deployed_on_apache> (eg: /var/www/html/admin/frontend)
  2. change ownership of folder <path_of_admin_ui_built_path_deployed_on_apache> to www-data (eg: chown -r root:www-data /var/www/html/admin/frontend)
  3. Restart apache2.
  4. The ui is available at https://{hostname}/admin

Adding a plugin to admin-ui

  1. In cloned admin-ui project directory add the plugin to plugins directory.
  2. In plugins.config.js file of cloned admin-ui project directory make plugin entry.
const plugins = [
  {
    key: '<name_of_plugin_folder>',
    metadataFile: './<name_of_plugin_folder>/plugin-metadata',
  },
]
  1. Create prod built using npm run built:prod. (For creating built for bank.gluu.org run npm run build:bank)
  2. Copy the built from dist folder to <path_of_admin_ui_built_path_deployed_on_apache> (eg: /var/www/html/admin/frontend)

Removing a plugin to admin-ui

  1. In cloned admin-ui project directory remove the plugin to plugins directory.
  2. In plugins.config.js file of cloned admin-ui project directory remove the plugin entry.
  3. Create prod built using npm run built:prod. (For creating built for bank.gluu.org run npm run build:bank)
  4. Copy the built from dist folder to <path_of_admin_ui_built_path_deployed_on_apache> (eg: /var/www/html/admin/frontend)
Clone this wiki locally