Custom Authentication
The default authentication mode of the product is LDAP authentication using the active directory of the system. Authentication is required for adding a user in the Admin Module and authenticating a user for Engage, Automation Studio, AEAttendedRPA and AlbieDecision Workbench.
In case you want to authenticate user with authentication type other than default LDAP authentication, you can implement your own custom authentication. Follow below step to write your own custom authentication.
To implement custom authentication:
- Create a Class Library project in visual studio.
- Add a reference of DLL System.ComponentModel.Composition.dll available with .Net framework 4 and above.
- Add reference of DLL Utilities.Interfaces.dll into the project. This DLL is present in the \Modules\Workflow\bin folder of the product build.
NOTE:
It is recommended to use the dll of the same version as the product version.
- Create a class in your project and provide ‘[Export(typeof(IUserManagement))]’ attribute on the class.
- Implement the interface IUserManagement available in the Utilities.Interfaces.dll. Provide implementation for all the below methods in the class.
- Implement your own authentication logic in AuthenticateUser method.
- Implement the methods GetUserByUserName, GetUsersByDisplayName and GetUsersByUserName to get the appropriate user data for Admin Module > User Management as per custom authentication logic.
public bool AuthenticateUser(Dictionary<string, object> authenticationParameter) public bool CustomLoginEnabled
public List<UserInfo> GetGroupByGroupName(string groupName) public UserInfo GetUserByUserName(string userName)
public List<UserInfo> GetUsersByDisplayName(string searchString) public List<UserInfo> GetUsersByGroupName(string groupName) public List<UserInfo> GetUsersByUserName(string searchString)//‘UserInfo‘ class contains below members public string DisplayName { get; set; } public string Email { get; set; }
public string FirstName { get; set; } public bool IsGroup { get; set; } public string LastName { get; set; }
public string UserName { get; set; }
public string AdditionalParameter { get; set; }
public int Id { get; set; } - Build the DLL in “Any CPU” mode and place it inside \Workflow\bin\ folder present at the location where the Workflow service is deployed.
- Changes required in Workflow service web.config:
- Enter the path of the custom authentication DLL and name of the class including the namespace. Refer to the sample below:
<!--For loading custiom authentication dll in Web applications-->
<add key="UserManagementDll" value="bin\Utilities.CustomUserManagement.dll" />
<!--Complete type name required including namespace-->
<add key="UserMngDllTypeClassName" value="Utilities.CustomUserManagement.UserManagementXMLData" /> - Update following components configuration to use custom authentication.
- Enter the path of the custom authentication DLL and name of the class including the namespace. Refer to the sample below:
- Set the value of the custom authentication key as true in the following config files:
- Automation Studio.exe.config file present at <<Build Folder>>\client-tools\AutomationStudio
- Engage.exe.config file present at <<Build Folder>>\client-tools\AutomationRuntime\Engage
- AEAttendedRPA.exe.config file present at <<Build Folder>>\client-tools\AutomationRuntime\AEAttendedRPA
- AlbieDecisionWorkbench.exe.config file present at <<Build Folder>>\client-tools\AutomationRuntime\AlbieDecisionWorkbench
<add key="CustomAuthentication"value="true" />
Custom Authentication Troubleshooting
If custom user authentication fails:
- Ensure that the user is added and has assigned the proper role in Admin Module > User Management.
- Ensure that the path of the custom code Dll and className is correct in workflow config.
- Check the custom code written for user authentication, check if it is working fine.