Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Trigger Automated Test example with authentication



I play around with your “Trigger Automated Test” script and was wondering what it would require to add authentication to this.

From what I found regarding the ui script, the ajax call should be extended with

username: < username >,
password: < password >,

for query 1.7.2+. Would this work for the on-demand system ?

What must be added to the php script side on the server to retrieve and check these authentication information ?



Hello Andreas,

Thanks for your posting. I would recommend implementing authentication for the trigger script independently of TestRail, especially if the PHP/trigger script is located on a different server. Handling authentication outside of TestRail makes the entire system more independent and flexible. It also wouldn’t be possible to reuse the TestRail usernames and passwords as the passwords are not stored anywhere (they are stored as hash in TestRail’s database).

So, adding an authentication mechanism independently of TestRail would work best and they are a variety of options for this such as API keys, secure tokens (e.g. JWT) or other ways to implement this.



Hi Tobias,

yes, you describe my idea, the implementation is what I’m currently struggling with - but thanks for the hints, I will check them, to see if I can realise it


Happy to help!