REST.Backend.EMSApi.TEMSClientAPI.LoginUser
Delphi
procedure LoginUser(const AUserName, APassword: string; out ALogin: TLogin;
const AJSON: TJSONArray; AProc: TLoginProc); overload;
procedure LoginUser(const AUserName, APassword: string;
AProc: TLoginProc); overload;
procedure LoginUser(const AUserName, APassword: string; out ALogin: TLogin;
const AJSON: TJSONArray = nil); overload;
C++
void __fastcall LoginUser(const System::UnicodeString AUserName, const System::UnicodeString APassword, /* out */ TLogin &ALogin, System::Json::TJSONArray* const AJSON, _di_TLoginProc AProc)/* overload */;
void __fastcall LoginUser(const System::UnicodeString AUserName, const System::UnicodeString APassword, _di_TLoginProc AProc)/* overload */;
void __fastcall LoginUser(const System::UnicodeString AUserName, const System::UnicodeString APassword, /* out */ TLogin &ALogin, System::Json::TJSONArray* const AJSON = (System::Json::TJSONArray*)(0x0))/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | REST.Backend.EMSApi.pas REST.Backend.EMSApi.hpp |
REST.Backend.EMSApi | TEMSClientAPI |
Description
Logs into the EMS server and obtains authentication data that TEMSClientAPI uses in future requests.
LoginUser receives the following parameters:
AUserName
is the username of the user that logs in.APassword
is the password of that username.ALogin
is an instance of TLogin that LoginUser fills with the authentication data that the EMS server sends.AJSON
is an optional JSON array where LoginUser adds the JSON object of the response from the EMS server.AProc
is an optional procedure of type TLoginProc. LoginUser calls this procedure with the following parameters: the login data object (ALogin
) and the JSON object that the EMS server sends.
Exceptions
Exception | Message | Description |
---|---|---|
MasterSecret required |
Authentication is TAuthentication.MasterSecret and ConnectionInfo.MasterSecret is an empty string. | |
Session token expected |
The response from the EMS server does not contain a session token. The response from the EMS server must be a JSON object of login data that contains a key-value pair with the value of TJSONNames.SessionToken as key. | |
Session token required |
Authentication is TAuthentication.Session and you did not log in or the session authentication token that you provided to Login is an empty string. |
See Also
- REST.Backend.EMSApi.TEMSClientAPI.AddUser
- REST.Backend.EMSApi.TEMSClientAPI.RetrieveUser
- REST.Backend.EMSApi.TEMSClientAPI.RetrieveCurrentUser
- REST.Backend.EMSApi.TEMSClientAPI.UpdateUser
- REST.Backend.EMSApi.TEMSClientAPI.QueryUserName
- REST.Backend.EMSApi.TEMSClientAPI.RetrieveUsersNames
- REST.Backend.EMSApi.TEMSClientAPI.RetrieveUsersFields
- REST.Backend.EMSApi.TEMSClientAPI.QueryUsers
- REST.Backend.EMSApi.TEMSClientAPI.SignupUser
- REST.Backend.EMSApi.TEMSClientAPI.LogoutUser
- REST.Backend.EMSApi.TEMSClientAPI.DeleteUser