Creating a custom authentication module

General information

The standard LDAP integration module EleWise.ELMA.IntegrationLdap.Web supports integration with only one LDAP server at a time. If you require authentication on several servers, custom methods for working with the directory service server or support of other systems, you can create a custom integration module.
Before creating a custom authentication module, read these articles on development:
Server part
LdapExternalMembershipService class.
It is an implementation of the extension point of the external authentication EleWise.ELMA.Security.IExternalMembershipService
ServiceUid – UID of the implemented authentication service. The User object in ELMA stores this number in the AuthProviderGuid attribute.
Description – brief description. Used to display the service name in the web (e.g. in a user profile or when importing users)
Sync – method for synchronizing the user data from the authentication service with an ELMA user attributes.
FindUsers – method for searching a user by a substring. Implements search of users in the authentication service by the searchString parameter. Returns a list of ELMA users.
GetSettings – method that returns the authentication service settings. Not used at the moment.
ValidateUser – not used at the moment.
LdapUserModelMembershipEventHandler class.
It is an implementation of the extension point of the authentication event handler EleWise.ELMA.Security.Services. IMembershipServiceEventHandler
Validating – method for validating authentication.
Validated – method that implements the actions performed after authentication.
SetPassword – method for changing a password. Not used at the moment.

Connection setting

To describe the integration module settings, the IntegrationLdapSettings class is used (server part of the module). The methods of the controllers IntegrationLdapSettingsController and IntegrationLdapSettingsModuleController (web part of the module) are responsible for the loading of views and display in Administration – System Settings.
Views of settings are in the module web part in ~/Views/IntegrationLdapSettings/
View.cshtml – settings display view
Edit.cshtml – settings editing view
Example of creating a custom module
As an example of a custom authentication module, the source code of the LDAP authentication project is attached.

Additional links