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:
Fetch user from CSV file
In this document, we demonstrated using CSV file
Fetch user from Database
Click here to know more on how to fetch user data from Database
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
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;
- Download Files and extract in your local storage folder. you will see a two folder:
aiv External Security
aiv SSO
Import both these projects in eclipse to make path changes in this sample project.
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.
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.
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.
To change path of this csv files in your project, expand src folder and open ExternalSecurityCSVImpl class file available in com.aiv.externalsecurity package.
Provide path of csv files here at variable BASE_PATH as shows in below image,
Save this class file, now expand sso project folder and open aivSSOImpl class, provide valid path to store log files.
Save this file and export whole project as a jar file and save it in local storage.
Do the same with external security, export aiv External security project as jar file and store it in local storage.
Paste External Security & SSO JAR File into location [C:\aiv\apache-tomcat\webapps\aiv\WEB-INF\lib]
In order to use it, you need enable SSO and External security from aiv Configuration page.
Click on Hamburger menu and Go to Administration > aiv Configuration section, Click the checkbox of External Security, as shown in figure.
Select the Secure Radio Button of Editable User Properties and Editable Roles Properties.
Enter in Security class name:
com.aiv.externalsecurity.ExternalSecurityCSVImpl
Enter in Admin Users: Admin
Enter in Admin Roles: Administrator
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
Select the Check box of User Defaults and Roles Defaults, as shown in figure.
Please go through SSO code explanation document before before proceeding to next step. Click here to go on SSO Code Explanation Page.
Click on SSO Configuration check box, it will enable SSO Configuration setting into aiv, as shown in figure.
Enter in class name:
com.aiv.sso.aivSSOImpl
, as shown in figure. [It impairments SSO Jar File class path]Click on save button to save the changes.
Restart the tomcat server
Once server started, Login into aiv, Go to Administration > User section you will find some new users added into aiv.
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