Skip to main content

Custom Login

There is a custom login feature that allows you to make the desired validations and transactions while logging into the eBA application.

Thanks to the method in a dll prepared during eBA login, it allows the user trying to log in according to some conditions. For example, these operations can be applied to log in with an e-mail address instead of a user id, and the received e-mail address value can be compared in osusers and returned true if the password is correct.


The important point here is that the ExternalUsername information is taken as a basis in user definitions.


Necessary definitions should be made under "Security" on the left in the 'Advanced' tab in the eBAConfigurationEditor, where the eBA application is configured.

```<```Security```>```
```<```key name="AuthenticationMode"```>```custom```<```/key```>```
```<```key name="AuthenticationType"```>```DLL```<```/key```>```
```<```AuthenticationDLL```>```
```<```key name="Path"```>```C:\BimserSolution\eBA\Common\eBACustomAuthentication.dll```<```/key```>```
```<```key name="TypeName"```>```eBACustomAuthentication.Authentication```<```/key```>```
```<```/AuthenticationDLL```>```
```<```key name="LoginMode"```>```external```<```/key```>```
```<```key name="ExternalUserMatch"```>```equal```<```/key```>```
```<```/Security```>```

In the definitions made under Security in the eBAConfigurationEditor, definitions such as the file path and name of the external DLL prepared have been made. In this example, the name of the method to be used in the DLL is Authenticate.

The Authenticate method is called when the user logs in. The purpose is to check whether you can log in in accordance with some conditions during login, that is, to validate. In this method, you can have any control you want. When you return a true value, the user will be logged in, while if you return a false value, the user will not be able to log in.


Example for the external DLL that needs to be prepared;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace eBACustomAuthentication
{
public class Authentication : eBAAuthenticationInterface.IeBAAuthentication
{
public bool Authenticate(string userid, string password)
{
The eBAAuthenticationInterface dll in the references is located in the i eba.net\common directory.
You should reference the dll on your own server.
if (userid == "adogru" && password == "0")
{
return true;
}
else if (userid == "hkar" && password == "0")
{
return true;
}
else if (userid == "okara@bimser.com.tr" && password == "0")
{
userid = "hkar";
return true;
}
else
{
return false;
}
}
}
}