# Login with POST and REST API

**URL:** <https://www.dolibarr.org/forum/t/login-with-post-and-rest-api/18384>\
**Category:** Developing for Dolibarr\
**Tags:** Linux\
**Created:** [January 14, 2020, 6:05pm UTC](https://www.dolibarr.org/forum/t/login-with-post-and-rest-api/18384 "2020-01-14T18:05:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ludini](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/l/779978/32.png) [@ludini](https://www.dolibarr.org/forum/u/ludini)\
**Post date:** [January 14, 2020, 6:05pm UTC](https://www.dolibarr.org/forum/t/login-with-post-and-rest-api/18384/1 "2020-01-14T18:05:36Z")

</div>

hi!!

we are developing a simple app to use dolibarr as backend, and i have a security issue:

the API documentation recommend that use the POST method to login to dolibar for security reasons. I agree with that, but i have malfunction: when i try to login with post method & CURL, i have a 403 forbidden error. My syntax is:

curl -X POST --header ‘Content-Type: application/json’ --header ‘Accept: application/json’ -d ‘{  
“login”: “mylogin”,  
“password”: “mypassword”,  
“reset”: 1  
}’ ‘[https://mydolibarrinstallation/api/index.php/login](https://mydolibarrinstallation/api/index.php/login)’

It’s the same that the api explorer uses, without the DOLAPIKEY header and the “entity” field ( I have tried with it too)

I can login with the POST method adding the credentials to the URL ([https://mydolibarrinstallation/api/index.php/login?user=myuser&password=mypassword&reset=1](https://mydolibarrinstallation/api/index.php/login?user=myuser&password=mypassword&reset=1)’, but it’s not secure because credentials are logged by the access.log in the server.

My dolibarr version is 10.0.6 over ubuntu 18.04, Apache/2.4.29 and PHP 7.2

can anyone try to login with POST & CURL and reply my error?

Thanks a lot!!

---

<div class="post-metadata">

**Author:** ![ludini](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/l/779978/32.png) [@ludini](https://www.dolibarr.org/forum/u/ludini)\
**Post date:** [January 16, 2020, 1:53pm UTC](https://www.dolibarr.org/forum/t/login-with-post-and-rest-api/18384/2 "2020-01-16T13:53:58Z")

</div>

Solved. Server problem.

BR
