Skip to content
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

org.apache.http.client.HttpResponseException: status code: 403, reason phrase: Forbidden #434

Open
wants to merge 12 commits into
base: PR-392
Choose a base branch
from

Conversation

kumarshorav11
Copy link

@kumarshorav11 kumarshorav11 commented Nov 1, 2019

I am getting this error while creating a job through -

Exception in thread "main" org.apache.http.client.HttpResponseException: status code: 403, reason phrase: Forbidden
	at com.offbytwo.jenkins.client.validator.HttpResponseValidator.validateResponse(HttpResponseValidator.java:11)
	at com.offbytwo.jenkins.client.JenkinsHttpClient.post_xml(JenkinsHttpClient.java:375)
	at com.offbytwo.jenkins.JenkinsServer.createJob(JenkinsServer.java:389)
	at com.offbytwo.jenkins.JenkinsServer.createJob(JenkinsServer.java:359)
	at com.hcl.OffByTwoJenkins.main(OffByTwoJenkins.java:31)

I am using below code -

HttpClientBuilder builder = HttpClientBuilder.create();
		JenkinsHttpClient client = new JenkinsHttpClient(uri, builder, "XXX", "XXX");
		JenkinsServer jenkins = new JenkinsServer(client);
		String sourceXML = readFile("src/main/resources/config.xml");
		System.out.println(String.format("Installed Jenkins Version >> %s", jenkins.getVersion().getLiteralVersion()));//works and gives correct result
		jenkins.createJob("test-nov1", sourceXML);

On Jenkins server, in security configuration, option - "Logged in User can do any thing" option is set. However, when I have selected option "Any user can do any thing " , I am able to create job by calling .createJob(String jobName, String jobXml). So, I donot know what actually I am missing ? what configuration needs to be changed in Jenkins server. I can't opt option "Any user can do any thing" for security reason. I am struggling to this since very long. Please help or suggest.

Thanks

based2 and others added 12 commits May 31, 2019 13:57
Bumps `jackson-databind.version` from 2.9.9 to 2.10.3.

Updates `jackson-annotations` from 2.9.9 to 2.10.3
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

Updates `jackson-core` from 2.9.9 to 2.10.3
- [Release notes](https://github.com/FasterXML/jackson-core/releases)
- [Commits](FasterXML/jackson-core@jackson-core-2.9.9...jackson-core-2.10.3)

Updates `jackson-databind` from 2.9.9 to 2.10.3
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This fixes a security vulnerability in this project where the `pom.xml`
files were configuring Maven to resolve dependencies over HTTP instead of
HTTPS.

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Bumps [dom4j](https://github.com/dom4j/dom4j) from 2.1.1 to 2.1.3.
- [Release notes](https://github.com/dom4j/dom4j/releases)
- [Commits](dom4j/dom4j@version-2.1.1...version-2.1.3)

Signed-off-by: dependabot[bot] <support@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants