-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POST API calls '403 No valid crumb was included in the request' #67
Comments
@cdancy If you reproduce the problem and consider this as valid, I can start working on a PR |
@tbouffard I faced the same issue, workaround it by using user/apitoken instead. See if that works for you? |
@tbouffard yeah send in a PR if you have the time as the "valid crumb" setting should be handled behind the scenes in this client without the user having to specify anything. And as @choweiyuan noted: you can always use a token but this is still a new bug of sorts. |
@choweiyuan yep, I am aware of this and this works pretty well.
@cdancy I plan to work on it on Thursday |
Always pass the JSESSIONID in addition to the crumb See https://jenkins.io/security/advisory/2019-07-17/#SECURITY-626 Closes cdancy#67
Good estimates I have this problem activating CSRF Protection in the latest LTS version crumb = $ (curl -u "admin: admin" -s 'http://192.168.10.2:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)') and then I pass it with the operation that I want to perform curl -u "admin: admin" -H "$ crumb" -X POST 'http://192.168.10.2:8080/job/ENV/build?delay=0sec' this is the way out <meta http-equiv = "Content-Type" content = "text / html; charset = utf-8" />
<title> Error 403 No valid crumb was included in the request </title>
</head>
<body> <h2> HTTP ERROR 403 </h2>
<p> Problem accessing / job / ENV / build. Reason:
<pre> No valid crumb was included in the request </pre> I would like to know what state this is or what is the new way of working with the API to launch groovy scripts Thanks in advance |
After a couple of hours of struggling, I was able to make it work with
|
Always pass the JSESSIONID in addition to the crumb See https://jenkins.io/security/advisory/2019-07-17/#SECURITY-626 Closes cdancy#67
Or, if you do not want to pass the crumb as header and for deleting a build $BUILD_NUMBER for a job $JOB_NAME, |
I faced this issue where disable/enable project by non admin user. or continuous disable/ enable by admin user |
is there any solutiion for this '403 No valid crumb was included in the request', I set up log in in Jenkins using Okta and SAML but I am getting this message everytime I login :( I was trying for many days, and no solutions seem to be working |
@satishpatro44 @MimoJSRepo are you facing an issue when you are using the |
my mistake. It's not jenkins-rest. Sorry. It is direct Jenkins UI. I though Jenkin Rest API is part of official Jenkins |
Yes, the Jenkins REST API is part of official Jenkins, see https://wiki.jenkins.io/display/JENKINS/Remote+access+API |
@tbouffard No, jenkins-rest is NOT part of official Jenkins. I am the person who put the link there along with other links to external REST API libraries. To be part of Jenkins, this project would have to be hosted under the https://github.com/jenkinsci organization. |
@martinda that is exactly what I had in mind, but probably, I wasn't clear enough 😉, so let me rephrase Jenkins officially provides REST API for machine interactions, see https://wiki.jenkins.io/display/JENKINS/Remote+access+API
|
Expected Behavior
Use the jenkins-rest lib with user/password credentials to perform GET or POST underlying Rest API calls
Current Behavior
All POST requests fail when running Jenkins 2.176.2+/2.186+ with error:
HTTP/1.1 403 No valid crumb was included in the request
Context
This issue only occurs when running Jenkins 2.176.2+/2.186+ and seems related to security settings changes: https://jenkins.io/security/advisory/2019-07-17/#SECURITY-626
This link provides workarounds to make the calls work but they
The security advisory suggests to now pass the session id retrieved when getting the crumb to all authenticated requests.
I currently don't know this session id is the
X-Jenkins-Session
header or theJSESSIONID
cookie.Steps to Reproduce (for bugs)
Base commit:
master
branch b3e01c0 (latest 0.0.19 release is also affected)CSRF Protection
and use theDefault Crumb Issuer
(see https://wiki.jenkins.io/display/JENKINS/CSRF+Protection)./gradlew clean build integTest
Debug http traces generated by integration tests
Your Environment
JVM: 1.8.0_212 ( 25.212-b04)
OS: Windows 10 10.0 amd64
The text was updated successfully, but these errors were encountered: