I am getting the following error when i try triggering a build using the following command:
curl http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
I also have faced the same issue and resolved it.
Consider, you have 2 Jenkins A and B. If you want to execute a build job present in Jenkins B, then you have to give the API token of Jenkins B. If you provide the API token of Jenkins A, it will show the authentication issue only.
This is the mistake I have did and it got resolved once I have changed the API token properly according to the required Jenkins.