REST.Backend.EMSApi.TEMSClientAPI.LoginUser

From RAD Studio API Documentation
Jump to: navigation, search

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

EEMSClientAPIError

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