Authentication with LDAP
This section introduces a simple business logic definition about authentication with LDAP.
- Usually, the LDAP server information and Domain will not be the same for different environments, therefore define the LDAP Server name and Domain in %%AppConfig
- Define a simple Business Worksheet and use the function =ajAuthenLdap(), in C9, key in the following formula. Then the input parameters are user name and password from cell C3 and C4. The output result is C9 where it returns the authentication result.
=ajAuthenLdap('%%AppConfig'!B5, '%%AppConfig'!B6, C3, C4,FALSE)
- The input parameters are single value in text format, thus set the Class as String. The Data Addresses are Authentication!C3 and Authentication!C4. It is strongly recommended to use the ajGetAddress to set the Data Address, e.g. ajGetAddress(Authentication!C3). This is so that when the cell address is changed due to adding or removing some range, it will be re-calculated automatically. The input configurations of this function is as shown in the screenshot below.
- The output parameter is a boolean value, therefore in the Functions section set the Return Class as Boolean. The Return Data Address is Authentication!C9. The configurations of this function is as shown in the screenshot below.
- Input the range you have used in the Business Logic worksheet in the Related Worksheets section of API Class Definition Sheet to create the linkage between Class Definition Sheet and Business Logic Sheet.
- Done! You can click the Run Function Point button on the AlchemyJ toolbar to test it. TRUE would be returned on the cell Authentication!C9 if the configuration and the inputted user name and password are both correct. Otherwise, FALSE would be returned.