[Serializable] public class TAuthenticate;
Models an attempt to Authenticate a user. A user may attempt to authenticate by passing a username and password, or by passing a token previously obtained.
The user can be an Employer, a Client or a Staff Member.
A Token is generated when a user calls a Validate function (ValidateClient, ValidateEmployer or ValidateUser) and passes a valid username and password.
Both Clients and Staff generate Client Tokens (TokenType = CLIE_TOKEN = '02'), while Employers generate Employer Tokens (TokenType = EMPL_TOKEN = '01').
If an Authentication attempt is successful, a 'good' TAuthenticate is returned, containing:
If an Authentication attempt is unsuccessful, a 'bad' TAuthenticate is returned, containing:
Note that the ValidateUser function returns (on successful authentication of a Staff User) a TAuthenticate object containing a Client token and TokenType = STAF_TOKEN = '03'.
Many functions which perform operations with non-public data, require a Token and return an TAuthenticate Object.
Often the TAuthenticate object returned is a property (usually .Auth) of another object. For example, with the function GetEnrolmentsForClient, (which returns a TAuthEnroList), it is GetEnrolmentsForClient.Auth .
Often a function will use a TAuthenticate object as a means of communucating other information - perhaps information about errors other than authentication. For example, a valid token may be passed to a function, but other errors may occur in executing the function. In such cases, a 'bad' TAuthenticate is returned - check the StatusMessage for clues as to what went wrong.
Copyright (c) OzSoft Solutions 2016. All rights reserved.