Skip to main content

AIV SSO & External security

Introduction

AIV allow single sign on option so that aiv can be integrated with third party application as an integrated solution. In this exercise you will learn to implement simple Single sign on code which will validate users against users available in aiv.

In order to work with SSO first we need to fetch users from client source. source might be CSV file or database.

AIV allow configuring external security so that you do have to redefine users and roles within aiv application, to use external security you need to implement a java interface.

In this Document you will learn to implement simple Single sign on and external security which will validate users against CSV file. Sample Project File for SSO and External security can be downloaded from Here..

There are 3 ways to get users in aiv using external security:

  1. Fetch user from CSV file

    In this document, we demonstrated using CSV file

  2. Fetch user from Database

    Click here to know more on how to fetch user data from Database

  3. Fetch user from LDAP

    Click here to know more on how to fetch user data from LDAP

Data file you required:

(a) SSO and External security project files

(b) Eclipse IDE

Prerequisites

Downloaded Sample project from Here..

Implement Exteral Security

info

Amoung the 3 ways of fethcing user using Exteral Security mentioned above, here we are demonstrating it using CSV file.

Follow below steps to Implement external security with CSV file;

  1. Download Files and extract in your local storage folder. you will see a two folder:
  • aiv External Security

  • aiv SSO

  1. Import both these projects in eclipse to make path changes in this sample project.

    Docusaurus Slash Introduction

info

If you are facing errors in project after importing in to eclipse, go to build path and change external and Mysql jar path. both jar file is attached with sample zip project you have downloaded.

  1. Now, expand external security project, and expand files folder. This files folder contains csv files for user, role and user-role mapping sample information and other .properties files which will be used in case when your user data resides in database.

    Docusaurus Slash Introduction

info

This csv contains sample data information of users for demo purpose, you can change csv file to work with your user data. But make sure changes you made in users.csv file should be horizontally implemented in all other csv files wherever required.

  1. To change path of this csv files in your project, expand src folder and open ExternalSecurityCSVImpl class file available in com.aiv.externalsecurity package.

    Docusaurus Slash Introduction

  2. Provide path of csv files here at variable BASE_PATH as shows in below image,

    Docusaurus Slash Introduction

  3. Save this class file, now expand sso project folder and open aivSSOImpl class, provide valid path to store log files.

    Docusaurus Slash Introduction

info

Please find Code explanation of SSO class from Here..

Also Please find code explanation of External security project from Here..

  1. Save this file and export whole project as a jar file and save it in local storage.

  2. Do the same with external security, export aiv External security project as jar file and store it in local storage.

  3. Paste External Security & SSO JAR File into location [C:\aiv\apache-tomcat\webapps\aiv\WEB-INF\lib]

  4. In order to use it, you need enable SSO and External security from aiv Configuration page.

  5. Click on Hamburger menu and Go to Administration > aiv Configuration section, Click the checkbox of External Security, as shown in figure.

  6. Select the Secure Radio Button of Editable User Properties and Editable Roles Properties.

    Docusaurus Slash Introduction

  7. Enter in Security class name: com.aiv.externalsecurity.ExternalSecurityCSVImpl

  8. Enter in Admin Users: Admin

  9. Enter in Admin Roles: Administrator

info

If you are fetching user data from database, then class name should be the com.aiv.externalsecurity.ExternalSecurityDBImpl and in case of LDAP class name should be com.aiv.externalsecurity.ExternalSchemaLDAPImpl

  1. Select the Check box of User Defaults and Roles Defaults, as shown in figure.

    Docusaurus Slash Introduction

danger

Please go through SSO code explanation document before before proceeding to next step. Click here to go on SSO Code Explanation Page.

  1. Click on SSO Configuration check box, it will enable SSO Configuration setting into aiv, as shown in figure.

    Docusaurus Slash Introduction

  2. Enter in class name: com.aiv.sso.aivSSOImpl, as shown in figure. [It impairments SSO Jar File class path]

  3. Click on save button to save the changes.

  4. Restart the tomcat server

  5. Once server started, Login into aiv, Go to Administration > User section you will find some new users added into aiv.

info

If you are not allowed to login using admin user, check in ai_user table admin user is in Active state or Inactive state. Make it Active if InActive and try to login now with admin user.

In case if user or roles not displayed in user or role section, check Logs in Logs folder