Intellicus Enterprise Reporting and Business Insights 19.1

Admin Activities Performed through SSO

0 views September 22, 2020 0

Admin activities deal with the action performed by Admin user of Intellicus.

It includes User Management at Intellicus.

User management takes care of following activities:

User create/activate/delete/suspend operation initiated by Admin User.

For admin activities in Intellicus, host application need to send admin user credentials to Intellicus. This admin user should exist in Intellicus and must have super administrator system privilege.

Integration Flow

Integration Flow

Steps:

  1. In Host Application, user sends request for admin activity at Intellicus. With this request host application sends user credentials, Intellicus admin user credentials and appropriate action code.
  2. Using Intellicus SSO Libraries, host application send request for Intellicus Controller API.
  3. Intellicus web server send request to report server for admin activity.

A status message is sent back to the host application both in case of activity requested is performed successfully or failed.

Host Application on Java Platform

Implementation code can be written inside any JSP or servlet of Host application.

  1. Host application need to add ijar in their application.
  2. Host application need to import class Enums.java, SingleSignOn.java, SingleSignOnjava, UserInfo.java.

import com.intellicus.integration.singlesignon.Enums;

import com.intellicus.integration.singlesignon.SingleSignOn;

import com.intellicus.integration.singlesignon.SingleSignOn Exception;

import com.intellicus.integration.singlesignon.UserInfo;

  1. Make an object of SingleSignOn class for invoking the methods of this class.
  2. Make an object of UserInfo class and set the user credentials using the setter methods provided by UserInfo class.

Constructor

public UserInfo()

Constructor

public UserInfo (String userId,String password,String orgId)

Parameters:

userId: User Id of the logged in user

password: Password of the logged in user.

orgId: Organization id of the logged in user

Constructor

public UserInfo (String userId, String orgId)

Parameters:

userId: User Id of the logged in user.

orgId: Organization id of the logged in user.

  1. Pass this userInfo object to SingleSignOn class using the setUserInfo (userInfo) method.

public void setUserInfo(UserInfo userInfo)

Parameters:

  • UserInfo: Object reference of UserInfo class.
  1. Make an object of UserInfo class for Admin user info. Set the user credentials for Admin user in Intellicus in this object.
  2. Set the IntellicusUrl.
  3. Intellicus url can be read from property file or some database or repository.
  4. Set the action code. Action code is required to specify which action admin user want to perform in Intellicus.

Action code can be:

ACTIVATE_USER

DELETE_USER

SUSPEND_USER

CREATE_USER

MODIFY_USER

S.No Admin Activity Action Code Enum Provided by Intellicus
1. Create a user: Admin can create a user at intellicus end. CREATE_USER Enums.ActionCodes.CREATE_USER
2. Suspend a user: Admin can suspend an active user. SUSPEND_USER Enums.ActionCodes.SUSPEND_USER
3. Activate a user: Admin can activate a suspended user. ACTIVATE_USER Enums.ActionCodes.ACTIVATE_USER
4. Delete a user: Admin can delete an active or suspended user. DELETE_USER Enums.ActionCodes.DELETE_USER
5. Modify a user: Admin can modify a user. MODIFY_USER Enums.ActionCodes.MODIFY_USER
  1. Set the user role. User role specifies which type of role admin wants to assign to newly created user.
  2. Call the callIntellicusControllerAPI() method of SingleSignOn class to send the request to Intellicus for Admin Activity.

Method:

This method calls Intellicus API and passes the user credentials to Intellicus.

public String callIntellicusControllerAPI() throws IOException

Returns:

String:  Received Status message from Intellicus

S.No Activity Status at Intellicus Status Message Enum Provided by Intellicus
1. ‘user suspend’ operation requested by admin is completed. USER SUSPEND SUCCEEDED Enums. ResponseMessages.USER_SUSPEND_SUCCEEDED

 

2. ‘user activate’ operation requested by admin is completed. USER ACTIVATION SUCCEEDED Enums.ResponseMessages .USER_ACTIVATION_SUCCEEDED

 

3. ‘user suspend’ operation requested by admin for an ‘already suspended’ user. USER ALREADY SUSPENDED Enums.ResponseMessages .USER_ALREADY_SUSPENDED
4. ‘user activate’ operation requested by admin for an ‘already active’ user. USER ALREADY ACTIVATED Enums.ResponseMessages .USER_ALREADY_ACTIVATED
5. ‘user delete’ operation requested by admin is completed. USER DELETION SUCCEEDED Enums.ResponseMessages .USER_DELETION_SUCCEEDED

 

6. user to be activated/suspended/deleted does not exist at Intellicus. USER DOES NOT EXIST Enums.ResponseMessages .USER_DOES_NOT_EXIST
7. Report Server is down. COULD NOT CONNECT TO REPORT SERVER Enums.ResponseMessages .COULD_NOT_CONNECT_TO_REPORT_SERVER
8. User identification failed at Intellicus end. AUTHENTICATION FAILED Enums.ResponseMessages .AUTHENTICATION_FAILED

 

9. Intellicus Repository database is down. REPOSITORY DB IS DOWN Enums.ResponseMessages .REPOSITORY_DB_IS_DOWN

 

10. An unknown exception occurs at Intellicus. REPORTING NOT AVAILABLE Enums.ResponseMessages .REPORTING_NOT_AVAILABLE

 

11. ‘user create’ operation requested by admin is completed.

 

USER CREATION SUCCEEDED Enums.ResponseMessages .USER_CREATION_SUCCEEDED
12. ‘user create’ operation requested by admin was for an ‘already existing’ user. USER ALREADY EXIST Enums.ResponseMessages .USER_ALREADY_EXIST
13. ‘user modify’ USER MODIFICATION SUCCEEDED Enums.ResponseMessages. USER_MODIFICATION_SUCCEEDED

Note: Please refer IntellicusSSOAdminActivity.java  for sample code.
Path: <Install_Path>SampleCodesSingleSignOnJava

Sample Code:

try
{
	String actionCode=request.getParameter("ACTION_CODE");

SingleSignOn singleSignOn=new SingleSignOn();
	//Set user credentials for user to be activated/deleted/suspended by Admin user.
	// OR set the credentials for logged-in user for End -user requests.
	//user password is not required, if the authentication mode for organization is "Host Application."
	//These credentials can be fetched from the data structure maintained for the selected user.	
String hostAppUserid="userId";
String hostAppOrgId="orgId";
	  			
	UserInfo userInfo=new UserInfo();
	 			
	// Set user credentials for admin user.
	// Admin user credentials are required if some request for admin activity is raised.
	// Admin activities are like User Management, Database connection creation/modification etc.
	// These can be read from any property file or from repository/database.
String intellicusAdminUserId="Admin";	//This value can be read from any prperty file or database.
String intellicusAdminOrgId="Intellica";//This value can be read from any prperty file or database.
String intellicusAdminPassword="Admin";	//This value can be read from any prperty file or database.
	  			
UserInfo adminUserInfo=new UserInfo();
	adminUserInfo.setUserId(intellicusAdminUserId);
	adminUserInfo.setOrgID(intellicusAdminOrgId);
	adminUserInfo.setPassword(intellicusAdminPassword);
				
	SingleSignOn.setAdminUserInfo(adminUserInfo);
	  			
	// Set the path for Intellicus Web application
	// This can be read from any property file or from repository/database.
	  			singleSignOn.setIntellicusURL("http://localhost/intellicus");
	
//	This is for admin activities.
// Admin activity here deals with User Management at Intellicus.

if(actionCode!=null && actionCode.equals("ACTIVATE_USER"))
{
	singleSignOn.setActionCode(Enums.ActionCodes.ACTIVATE_USER);
	 }
	 else if(actionCode!=null && actionCode.equals("DELETE_USER"))
	   {
	  				singleSignOn.setActionCode(Enums.ActionCodes.DELETE_USER);
	  				
	 }
	 else if(actionCode!=null && actionCode.equals("SUSPEND_USER"))
	  {
		singleSignOn.setActionCode(Enums.ActionCodes.SUSPEND_USER);
	  				
}
else if(actionCode!=null && actionCode.equals("CREATE_USER"))
	  {
		singleSignOn.setActionCode(Enums.ActionCodes.CREATE_USER);
	  				
}

	//Set the credentials for  User to be suspended
	userInfo.setUserId(hostAppUserid);
	userInfo.setOrgID(hostAppOrgId);
	singleSignOn.setUserInfo(userInfo);
	  	  			
	String statusMsg=singleSignOn.callIntellicusControllerAPI();
	  				
PrintWriter out=response.getWriter();
out.println(statusMsg);
}
catch(SingleSignOnException e)// if connection for the intellicusURL can not be opened. Reason can be 
	  		//Intellicus url is wrong or Report Server is down.
{
e.printStackTrace();
	PrintWriter out=response.getWriter();
	out.println("Intellicus Web Application Not Available ");
	}
	catch(Exception e)
	{
		PrintWriter out=response.getWriter();
		out.println("Intellicus Web Application Not Available ");
	 }

 

Host Application on .Net Platform

Implementation code can be written inside any ASPX of Host application.

  1. Host application need to add intellicaSSO.dll in their application.
  2. Host application need to import namespace Intellicus.Integration.SingleSignOn.

using Intellicus.Integration.SingleSignOn;

  1. Make an object of SingleSignOn class for invoking the methods of this class.
  2. Make an object of UserInfo class and set the user credentials using the setter methods provided by UserInfo class.

Constructor

public UserInfo()

Constructor

public UserInfo (String userId,String password,String orgId)

Parameters:

userId : User Id of the logged in user

password: Password of the logged in user.

orgId : Organization id of the logged in user

Constructor

public UserInfo (String userId,String password,String orgId)

Parameters:

userId : User Id of the logged in user

orgId : Organization id of the logged in user

  1. Set this userInfo object to UserInfo property of SingleSignOn class.

singleSignOn.UserInfo = userInfo;

  1. Make an object of UserInfo class for Admin user info. Set the user credentials for Admin user in Intellicus in this object.
  2. Set the IntellicusUrl.

Intellicus URL can be read from property file or some database or repository.

  1. Set the action code. Action code is required to specify which action admin user want to perform in Intellicus.

Action code can be:

ACTIVATE_USER

DELETE_USER

SUSPEND_USER

CREATE_USER

S.No Admin Activity Action Code Enum Provided by Intellicus
1. Create a user: Admin can create a user at intellicus end. CREATE_USER Enums.ActionCodes.CREATE_USER
2. Suspend a user: Admin can suspend an active user. SUSPEND_USER Enums.ActionCodes.SUSPEND_USER
3. Activate a user: Admin can activate a suspended user. ACTIVATE_USER Enums.ActionCodes.ACTIVATE_USER
4. Delete a user: Admin can delete an active or suspended user. DELETE_USER Enums.ActionCodes.DELETE_USER
  1. Set the user role. User role specifies which type of role admin wants to assign to newly created user.
  2. Call the callIntellicusControllerAPI () method of SingleSignOn class to send the request to Intellicus for Admin Activity.

Method:

This method calls Intellicus API and passes the user credentials to Intellicus. It throws SingleSignOnException.

public String callIntellicusControllerAPI()

Returns:

String:  Received Status message from Intellicus

S.No Activity Status at Intellicus Status Message Enum Provided by Intellicus
1. ‘user suspend’ operation requested by admin is completed. USER SUSPEND SUCCEEDED Enums. ResponseMessages.USER_SUSPEND_SUCCEEDED

 

2. ‘user activate’ operation requested by admin is completed. USER ACTIVATION SUCCEEDED Enums.ResponseMessages .USER_ACTIVATION_SUCCEEDED

 

3. ‘user suspend’ operation requested by admin for an ‘already suspended’ user. USER ALREADY SUSPENDED Enums.ResponseMessages .USER_ALREADY_SUSPENDED
4. ‘user activate’ operation requested by admin for an ‘already active’ user. USER ALREADY ACTIVATED Enums.ResponseMessages .USER_ALREADY_ACTIVATED
5. ‘user delete’ operation requested by admin is completed. USER DELETION SUCCEEDED Enums.ResponseMessages .USER_DELETION_SUCCEEDED

 

6. user to be activated/suspended/deleted does not exist at Intellicus. USER DOES NOT EXIST Enums.ResponseMessages .USER_DOES_NOT_EXIST
7. Report Server is down. COULD NOT CONNECT TO REPORT SERVER Enums.ResponseMessages .COULD_NOT_CONNECT_TO_REPORT_SERVER
8. User identification failed at Intellicus end. AUTHENTICATION FAILED Enums.ResponseMessages .AUTHENTICATION_FAILED

 

9. Intellicus Repository database is down. REPOSITORY DB IS DOWN Enums.ResponseMessages .REPOSITORY_DB_IS_DOWN

 

10. An unknown exception occurs at Intellicus. REPORTING NOT AVAILABLE Enums.ResponseMessages .REPORTING_NOT_AVAILABLE

 

11. ‘user create’ operation requested by admin is completed.

 

USER CREATION SUCCEEDED Enums.ResponseMessages .USER_CREATION_SUCCEEDED
12. ‘user create’ operation requested by admin was for an ‘already existing’ user. USER ALREADY EXIST Enums.ResponseMessages .USER_ALREADY_EXIST

Note: Please refer IntellicusSSOAdminActivity.aspx  for sample code.
Path: <Install_Path>SampleCodesSingleSignOnDotNet

Sample Code:

try
{
    String actionCode = "SUSPEND_USER";
    SingleSignOn singleSignOn = new SingleSignOn();

#region Creating UserInfo
//Set user credentials for user to be 
//activated/deleted/suspended by Admin user.
//user password is not required, if the authentication mode  
//for organization is "Host Application."
//These credentials can be fetched from the data structure 
//maintained for the selected user.
    String hostAppUserid = "a";
    String hostAppOrgId = "k31";

//set the credentials for the user to be 
//activated/deleted/suspended
    UserInfo userInfo =new UserInfo();
    userInfo.UserId = hostAppUserid;
    userInfo.OrgID = hostAppOrgId;
    singleSignOn.UserInfo = userInfo;

#endregion

#region Create AdminInfo

    // Set user credentials for admin user.
// Admin user credentials are required if some request for 
//admin activity is raised.
// this admin user should be present at Intellicus with 
//Superadmin system privileges.
// Admin activities are like User Management, Database 
//connection creation/modification etc.
// These can be read from any property file or from 
//repository/database.

//This value can be read from any prperty file or database.
String intellicusAdminUserId = "Admin";	
    //This value can be read from any prperty file or database.
String intellicusAdminOrgId = "Intellica”;
//This value can be read from any prperty file or database.
    String intellicusAdminPassword = "Admin";	

    UserInfo adminUserInfo =new UserInfo();
    adminUserInfo.UserId = intellicusAdminUserId;
    adminUserInfo.OrgID = intellicusAdminOrgId;
    adminUserInfo.Password = intellicusAdminPassword;

    SingleSignOn.AdminUserInfo = adminUserInfo;
#endregion

#region Set Intellicus Path and ActionCode
    // Set the path for Intellicus Web application
// This can be read from any property file or from 
//repository/database.
singleSignOn.IntellicusURL="http://192.168.33.165/intellicusvss";
  if (actionCode != null)
  {
    if (actionCode.Equals("ACTIVATE_USER"))
       singleSignOn.ActionCode = Enums.ActionCodes.ACTIVATE_USER;
    if (actionCode.Equals("DELETE_USER"))
       singleSignOn.ActionCode = Enums.ActionCodes.DELETE_USER;
    if (actionCode.Equals("SUSPEND_USER"))
       singleSignOn.ActionCode = Enums.ActionCodes.SUSPEND_USER;
  }

#endregion

#region Get Status Message
   //call the Intellicus controller API to activate/delet/suspend 
   //a user at Intellicus end.
   // It will return a status message both in case of operation 
   //success or failure.
   String statusMsg = singleSignOn.callIntellicusControllerAPI();

   Response.Write(statusMsg);
   Response.Write("<br>");
   Response.Write(userInfo.Locale);
   Response.Write("<br>");
   Response.Write(adminUserInfo.Locale);

#endregion

}
catch (SingleSignOnException ex)
{
   Response.Write(ex.Message);
}
catch (Exception exc)
{
   Response.Write(exc.Message);;
}
	 

 

Host Application on PHP Platform

Implementation code can be written inside any php or html files of Host application.

  1. Host application need to add intellicaSSO.php in their application.
  2. Host application file needs to include file intellicaSSO.php.

include_once(“intellicaSSO.php”);

  1. Make an object of SingleSignOn class for invoking the methods of this class.
  2. Make an object of UserInfo class and set the user credentials using the setter methods provided by UserInfo class.
  3. Pass this userInfo object to SingleSignOn class using the setUserInfo (userInfo) method.

public function setUserInfo($userInfo)

Parameters:

  • UserInfo : Object reference of UserInfo class.
  1. Make an object of UserInfo class for Admin user info. Set the user credentials for Admin user in Intellicus in this object.
  2. Set the IntellicusUrl.
  3. Intellicus URL can be read from property file or some database or repository.
  4. Set the action code. Action code is required to specify which action admin user want to perform in Intellicus.

Action code can be:

ACTIVATE_USER

DELETE_USER

SUSPEND_USER

CREATE_USER

MODIFY_USER

S.No Admin Activity Action Code Enum Provided by EnumsActionCodes class in intellicaSSO.php
1. Create a user: Admin can create a user at intellicus end. CREATE_USER CREATE_USER
2. Suspend a user: Admin can suspend an active user. SUSPEND_USER SUSPEND_USER
3. Activate a user: Admin can activate a suspended user. ACTIVATE_USER ACTIVATE_USER
4. Delete a user: Admin can delete an active or suspended user. DELETE_USER DELETE_USER
5. Modify a user: Admin can modify the attributes of any user. MODIFY_USER MODIFY_USER
  1. Set the user role. User role specifies which type of role admin wants to assign to newly created user.
  2. Call the callIntellicusControllerAPI () method of SingleSignOn class to send the request to Intellicus for Admin Activity.

Method:

This method calls Intellicus API and passes the user credentials to Intellicus.

public function callIntellicusControllerAPI()

Returns:

String: Received Status message from Intellicus

S.No Activity Status at Intellicus Status Message Enum Provided by Enums ResponseMessages class of intellicaSSO.php
1. ‘user suspend’ operation requested by admin is completed. USER SUSPEND SUCCEEDED USER_SUSPEND_SUCCEEDED

 

2. ‘user activate’ operation requested by admin is completed. USER ACTIVATION SUCCEEDED USER_ACTIVATION_SUCCEEDED

 

3. ‘user suspend’ operation requested by admin for an ‘already suspended’ user. USER ALREADY SUSPENDED USER_ALREADY_SUSPENDED
4. ‘user activate’ operation requested by admin for an ‘already active’ user. USER ALREADY ACTIVATED USER_ALREADY_ACTIVATED
5. ‘user delete’ operation requested by admin is completed. USER DELETION SUCCEEDED USER_DELETION_SUCCEEDED

 

6. User to be activated / suspended / deleted does not exist at Intellicus. USER DOES NOT EXIST USER_DOES_NOT_EXIST
7. Report Server is down. COULD NOT CONNECT TO REPORT SERVER COULD_NOT_CONNECT_TO_REPORT_SERVER
8. User identification failed at Intellicus end. AUTHENTICATION FAILED AUTHENTICATION_FAILED

 

9. Intellicus Repository database is down. REPOSITORY DB IS DOWN REPOSITORY_DB_IS_DOWN

 

10. An unknown exception occurs at Intellicus. REPORTING NOT AVAILABLE REPORTING_NOT_AVAILABLE

 

11. ‘user create’ operation requested by admin is completed.

 

USER CREATION SUCCEEDED USER_CREATION_SUCCEEDED
12. ‘user create’ operation requested by admin was for an ‘already existing’ user. USER ALREADY EXIST USER_ALREADY_EXIST
13. ‘user modify’ USER MODIFICATION SUCCEEDED USER_MODIFICATION_SUCCEEDED

Note: Please refer IntellicusSSOAdminActivity.php for sample code.
Path: <Install_Path>SampleCodesSingleSignOnPHP

Sample Code:

include_once("intellicaSSO.php"); 
try
{
	$sso=new SingleSignOn();

	// Set the path for Intellicus Web application
	// This can be read from any property file or from repository/database.
	// In lbMode, give the URL for LB application,
	// else give the URL for Intellicus Web application.
	$sso->setIntellicusURL("http://192.168.33.165/intellicus");

	//Set user credentials for user to be activated/deleted/suspended by Admin user.
	//user password is not required, if the authentication mode for organization is "Host Application."
	//These credentials can be fetched from the data structure maintained for the selected user.
	$userinfo=new UserInfo;
	$userinfo->setUserId("k1");
	$userinfo->setOrgID("ab");
	$sso->setUserInfo($userinfo);

	// Set user credentials for admin user.
	// Admin user credentials are required if some request for admin activity is raised.
	// this admin user should be present at Intellicus with Superadmin system privileges.
	// Admin activities are like User Management, Database connection creation/modification etc.
	// These can be read from any property file or from repository/database.
	$adminUserinfo=new UserInfo;
	$adminUserinfo->setUserId("Admin");
	$adminUserinfo->setPassword("Admin");
	$adminUserinfo->setOrgID("Intellica");
	$sso->setAdminUserInfo($adminUserinfo);

	//	This is for admin activities.
	// Admin activity here deals with User Management at Intellicus.
	$actionCode=$_REQUEST["ACTION_CODE"]; 

	if($actionCode=="ACTIVATE_USER")
	{
		$sso->setActionCode(EnumsActionCodes::$ACTIVATE_USER);
	}
	elseif($actionCode=="DELETE_USER")
	{
		$sso->setActionCode(EnumsActionCodes::$DELETE_USER);
	}
	elseif($actionCode=="SUSPEND_USER")
	{
		$sso->setActionCode(EnumsActionCodes::$SUSPEND_USER);
	}
	elseif($actionCode=="CREATE_USER")
	{
		$sso->setActionCode(EnumsActionCodes::$CREATE_USER);
	}

	echo $sso->callIntellicusControllerAPI();

}
catch(SingleSignOnException $e)
{
	print_r("Intellicus Web Application Not Available");
}
catch(Exception $e)
{	print_r("Intellicus Web Application Not Available");
}