Validates the user login credentials.
True if the valid credentials passed
else False
Primarly used in Forms validation
Namespace: CelloSaaS.ServiceContracts.UserManagementAssembly: CelloSaaS.ServiceContracts (in CelloSaaS.ServiceContracts.dll) Version: 4.3.1.0 (4.3.1.0)
Syntax
Parameters
- userName
- Type: System String
User Name(Mandatory)
- password
- Type: System String
Password(Mandatory)
- companyCode
- Type: System String
Company Code(Mandatory)
Return Value
Type: Booleanreturns True/False
Exceptions
Exception | Condition |
---|---|
CelloSaaS.ServiceContracts.UserManagement UserDeactivateException | If the user is in deactivated status. |
CelloSaaS.ServiceContracts.UserManagement UserLockedOutException | If the user is in locked status. |
CelloSaaS.ServiceContracts.UserManagement UserPasswordExpirationException | If the user's password is in expiry status. |
CelloSaaS.ServiceContracts.UserManagement UserDetailException | If any exception occur, while connecting or modifying the database. |
System ArgumentNullException | If user name or password or company code is null or empty. |
Examples
public void ValidateUser() { string userName = "[email protected]"; string password = "company"; string companyCode = "company"; IUserDetailsService userDetailsService = (IUserDetailsService)ServiceLocator.GetServiceImplementation(typeof(IUserDetailsService)); bool validUser = userDetailsService.ValidateUser(userName, password, companyCode); }
See Also