• Api Documentation
Show / Hide Table of Contents
  • Softadmin.Api
    • AdminMessageException
    • CustomComponent
    • ICookies
    • ICredentialsStore
    • IEnvironment
    • IForwardState
    • IHttpHeaders
    • IParameters
    • ISessionVariables
    • ISystemSettings
    • Plugin
  • Softadmin.Api.Database
    • IDbRequest
    • IDbRequestFactory
  • Softadmin.Api.Diagnostics
    • ILogger
  • Softadmin.Api.Login
    • IUserState
    • LoginPlugin
    • PostLoginPlugin
    • PreLoginPlugin
    • UserAuthenticationPlugin
  • Softadmin.Api.Logout
    • LogoutPlugin
  • Softadmin.Api.Page
    • ICustomPage
    • PagePlugin
  • Softadmin.Api.Ui
    • IDebugWindow
    • IProgressWindow

Class UserAuthenticationPlugin

A plugin that validates username/password pairs.

Inheritance
System.Object
Plugin
UserAuthenticationPlugin
Inherited Members
Plugin.RequestFactory
Plugin.SessionVariables
Plugin.SystemSettings
Plugin.Cookies
Plugin.Environment
Plugin.CreateObjRef(Type)
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 null to reject the password. The username must match an existing, enabled user account.

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.

In This Article
Back to top Generated by DocFX