-
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
ForbiddenException occurs when triggering remote build using Job Authentication token #237
Comments
@mubinB interesting ... maybe a VPN related issue? Can you run with debug logs enabled in however you would do so with your java process? The library will output the http wire logs and allow us to see what's going on. |
The |
Hello. I'm facing a similar issue. The method CrumbParser#sessionIdCookie try to get the values, from the headers multimap, using the key "Set-Cookie" (it use HttpHeaders#SET_COOKIE), but Jenkins crumb response use "set-cookie" as header name. In this way the JSESSIONID is not included in the build request and it cause the failure. Is there a way to override this behaviour without modifying the library? e.g. using some custom com.google.inject.Module? EDIT: ok, configuring a module that register my custom CrumbParser that use "set-cookie" worked as expected. I don't know if there could be a better way to do it. |
@felicepagano interesting ... can you send in a quick PR to fix this in the library perhaps checking for both versions? |
|
Hello I'm facing a similar issue when i try to get the queue ID i got this error: IntegerResponse{value=null, errors=[Error{context=null, message=For input string: "2363039249704479081", exceptionName=java.lang.NumberFormatException}]} |
@outhmane96 I think your issue is related to |
Hi,
I am triggering remote builds using this wrapper library...
My client setup is as below.
JenkinsClient.builder().endPoint(MY_JENKINS_URL).build();
Expected Behavior
// Adding token as a query parameter
Map<String, List> properties = new HashMap<>();
properties.put("token", Arrays.asList("MY_TOKEN"));
properties.put("name", Arrays.asList("test_param"));
IntegerResponse response = jenkinsClient.api().jobsApi().buildWithParameters(null, JOB_NAME, properties);
Here response.value(). must return the queueId.
Current Behavior
Calling above code returns below exception
IntegerResponse{value=null, errors=[Error{context=POST http://JENKINS_URL/job/JOB_NAME/buildWithParameters HTTP/1.1, message=, exceptionName=com.cdancy.jenkins.rest.exception.ForbiddenException}]}
Context
Note: Calling using POSTMAN triggers builds as expected. Problem is with just Java Wrapper.
POSTMAN URL: http://JENKINS_URL/job/JOB_NAME/buildWithParameters?token=MY_TOKEN&name=test_param
I am unable to remotely trigger builds...
Your Environment
Jenkins server on windows 10.
Jenkins version: Jenkins 2.287
Windows 10, JDK 11.
The text was updated successfully, but these errors were encountered: