Situation: we created our own testrail server (in trial version still), using LDAP/AD. Everything works as expected including the Jira integration, except the API. No matter what we try we cannot authenticate. HTTP 401 (“Authentication failed: invalid or missing user/password or session cookie.”)
I tried the following via CURL (CLI), PHP, Postman, VisualJSON and some other tools all with the same result:
username: [email address]
password: [API key]
I created several API keys and made sure they are indeed saved. I disabled AD authentication and still same error. I tried without AD authentication and e-mail address and my normal password still nothing.
I also made sure that under Site settings API is enabled (also enabled the session authentication for API), removed it and saved it again all but to no avail.
I’ve asked colleagues to the same and they had the same issue. I searched everywhere via google, this forum and all the answers people got are not working for us. The most common one is that people forget to use their e-mail address when using an API key as drop-in-replacement for the password. This was not my issue.
Below an example from the system log:
[AuthException] Authentication failed: invalid or missing user/password or session cookie.
Status Code: 500
Uri: /index.php?/api/v2/get_users (GET)
Server: Linux 2.6.32-573.12.1.el6.x86_64 #1 SMP Tue Dec 15 21:19:08 UTC 2015 x86_64
at ex::raise (ex.php:77)
at ex::raiset (v2.php:143)
at V2_controller->_check_user (v2.php:19)
at V2_controller->_init (gizmo.php:106)
at require_once (index.php:106)