JENKINS Authentication Fails

nnc picture nnc · Aug 20, 2014 · Viewed 31.3k times · Source

I am getting the following error while trying to trigger Jenkins job from any REST Client

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>

The request is getting triggered while using curl from terminal

I am using the following syntax

http://user:[email protected]/job/your_job/build?token=TOKEN [ref :https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients]

ie. curl -X POST http://user:[email protected]/job/your_job/build?token=TOKEN

Answer

Juhi Saxena picture Juhi Saxena · Aug 3, 2015

Check this "This build is parameterized " , select the credentials parameter from drop down. Use this

curl -X POST http://jenkins.rtcamp.com/job/Snapbox/buildWithParameters --user "username:password"

It solved my authentication problem.

I hope it will help others too.