I am trying to build a python script that will build jobs externally but when I am executing it, throws 403 forbidden error for build jobs call other get APIs are working fine. Below is the python snippet.
j=jenkins.Jenkins('http://localhost:8080/login?from=%2F', 'admin', 'admin@123' )
j.get_jobs();
print(j.jobs_count());
print(j.get_jobs());
j.build_job('demo1');
Jenkins details: I am able to create & build jobs from UI successfully. My Jenkins version is 2.237.
Other settings.
- logged in user can do anything. Csrf protection is disabled. On the other hand my friend having the same script and version of Jenkins is able to build job.