Summary
The downloadable solution contains a new project for the new XML authentication plug-in: AuthenticationPlugin.Plugins.XmlAuthenticator. This new project contains the Plugin class, which implements the IAuthenticationPlugin and defines the IsLoginValid method. The new plug-in searches through an XML file with an XPath to find a user.
Also, the test UI application was modified to demonstrate the use of a custom configuration handler to process a custom configuration section added to the application's configuration file.
Let's review the steps to create a new plug-in:
-
Add a new Class library project to the solution.
-
Build a class in the new project that has the AuthenticationPlugin attribute and implements the IAuthenticationPlugin interface.
To add a new custom configuration section to an application's configuration file:
-
Declare the new configuration section in the configuration file, using the configuration section's key name and the class name of the handler.
-
Build a new handler class that implements the IConfigurationHandler interface.
-
Optionally, build a class that holds the configuration values to be easily obtained by an application.
-
Add code to the application to use the class to process the custom settings.
The next article in this series will introduce two new plug-ins, as well as discuss the configuration of the actual plug-ins themselves.