REST.Backend.EMSServices.TEMSLoginAPI.LoginUser
Delphi
procedure LoginUser(const AUserName, APassword: string; AProc: TFindObjectProc); overload;
procedure LoginUser(const AUserName, APassword: string; out AUser: TBackendEntityValue; const AJSON: TJSONArray); overload;
C++
void __fastcall LoginUser(const System::UnicodeString AUserName, const System::UnicodeString APassword, Rest::Backend::Servicetypes::_di_TFindObjectProc AProc)/* overload */;
void __fastcall LoginUser(const System::UnicodeString AUserName, const System::UnicodeString APassword, /* out */ Rest::Backend::Metatypes::TBackendEntityValue &AUser, System::Json::TJSONArray* const AJSON)/* overload */;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
procedure function |
protected | REST.Backend.EMSServices.pas REST.Backend.EMSServices.hpp |
REST.Backend.EMSServices | TEMSLoginAPI |
Description
Logs into the EMS server and obtains authentication data that you can use in future requests.
You must specify the username of the user that logs in (AUserName) and the password of that username (APassword).
To handle the received information, you must provide either of the following:
- An instance of TBackendEntityValue (
AUser) and a JSON array (AJSON). LoginUser fillsAUserwith the received data and appends the received JSON object toAJSON. - A procedure of type TFindObjectProc (
AProc). LoginUser calls your procedure and provides the received authentication data as a JSON object.
Exceptions
| Exception | Message | Description |
|---|---|---|
|
MasterSecret required |
The type of authentication is TAuthentication.MasterSecret and the MasterSecret property of the connection information of the underlying EMS backend service 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 |
The type of authentication is TAuthentication.Session you did not log in. |