dolibarr 21.0.0-alpha
|
API that allows to log in with an user account. More...
Public Member Functions | |
__construct () | |
Constructor of the class. | |
loginUnsecured ($login, $password, $entity='', $reset=0) | |
Login. | |
index ($login, $password, $entity='', $reset=0) | |
Login. | |
API that allows to log in with an user account.
Definition at line 29 of file api_login.class.php.
Login::index | ( | $login, | |
$password, | |||
$entity = '', | |||
$reset = 0 ) |
Request the API token for a couple username / password. WARNING: You should NEVER use this API, like you should never use the similar API that uses the POST method. This will expose your password. To use the APIs, you should instead set an API token to the user you want to allow to use API (This API token called DOLAPIKEY can be found/set on the user page) and use this token as credential for any API call. From the API explorer, you can enter directly the "DOLAPIKEY" into the field at the top right of the page to get access to any allowed APIs.
string | $login | User login |
string | $password | User password |
string | $entity | Entity (when multicompany module is used). '' means 1=first company. |
int | $reset | Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access) |
RestException | 403 Access denied |
RestException | 500 System error |
@url POST /
Definition at line 93 of file api_login.class.php.
References ascii_check(), checkLoginPassEntity(), dol_hash(), dol_syslog(), dolEncrypt(), getDolGlobalString(), and utf8_check().
Referenced by loginUnsecured().
Login::loginUnsecured | ( | $login, | |
$password, | |||
$entity = '', | |||
$reset = 0 ) |
Request the API token for a couple username / password. WARNING: You should NEVER use this API, like you should never use the similar API that uses the POST method. This will expose your password. To use the APIs, you should instead set an API token to the user you want to allow to use API (This API token called DOLAPIKEY can be found/set on the user page) and use this token as credential for any API call. From the API explorer, you can enter directly the "DOLAPIKEY" into the field at the top right of the page to get access to any allowed APIs.
string | $login | User login |
string | $password | User password |
string | $entity | Entity (when multicompany module is used). '' means 1=first company. |
int | $reset | Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access) |
RestException | 403 Access denied |
RestException | 500 System error |
@url GET /
Definition at line 69 of file api_login.class.php.
References index().