I'm trying configure my Jenkins to allow remote job trigger using REST API. If I pass username and password using basic authentication header param, I'm able to trigger the job
-u <username>:<api token> http://localhost:8080/job/kp-push-example/build
However if I pass username and api token in url, Jenkins is unable to authenticate, it uses anonymous user and throws error, as anonymous user does not have prevailage to execute the job.
http://<username>:<apitoken>@localhost:8080/job/kp-push-example/build
Below is the error message.
<html>
<head>
<meta http-equiv='refresh' content='1;url=/login?from=%2Fjob%2Fkp-push-example%2Fbuild'/>
<script>window.location.replace('/login?from=%2Fjob%2Fkp-push-example%2Fbuild');</script>
</head>
<body style='background-color:white; color:white;'>
Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:
Permission you need to have (but didn't): hudson.model.Hudson.Read
... which is implied by: hudson.security.Permission.GenericRead
... which is implied by: hudson.model.Hudson.Administer
-->
</body>
</html>
How to configure Jenkins to allow url basic auth? Jenkins version: 2.129