Class UserAuthenticationPlugin
A plugin that validates username/password pairs.
Inherited Members
Namespace: Softadmin.Api.Login
Assembly: Softadmin.Api.dll
Syntax
public abstract class UserAuthenticationPlugin : Plugin
Remarks
Subclass this plugin and override AuthenticateUser(String, String, Boolean) to provide your own password validation.
This plugin is only called if built-in authentication rejects the username and password so
set the password in SoftadminApi.User
to null
for those users that should only
be authenticated through this plugin.
Examples
public override string AuthenticateUser(string username, string password, bool exists)
{
return exists && this.PasswordWebService.AuthenticateUser(username, password) ? username : null;
}
Methods
AuthenticateUser(String, String, Boolean)
Checks a username and password.
Declaration
public abstract string AuthenticateUser(string username, string password, bool exists)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | The username. |
System.String | password | The password. |
System.Boolean | exists | Whether an enabled user with this name exists. |
Returns
Type | Description |
---|---|
System.String | Username of the user account to log in the client as, or |
Exceptions
Type | Condition |
---|---|
AdminMessageException | User friendly message explaining to the client why authentication failed. For example because a third party authentication server is unreachable. The client will be prevented from logging in. |
System.Exception | Any other exception thrown by this method will be caught and logged and the client will be prevented from logging in. |