python jenkins.jenkins module: how to login to jenkins with third party sso

2.2k views Asked by At

I need to automate jenkins, It is very easy to login to jenkins from python with its local-user/password. But our jenkins server is configured with assembla sso and I am not able to login through jenkins.jenkins python module. Can any oen suggest how to login to jenkins server with third party sso configuration.
python api docs: https://python-jenkins.readthedocs.org/en/latest/api.html

I am open to use any other module.

import jenkins
j = jenkins.Jenkins('http://your_url_here', 'username', 'password')
j.get_jobs()
1

There are 1 answers

0
user87005 On

After successful login via third party sso. get the API Token from this page (http:///user//configure) and use api token as a password with username to login into Jenkins server.

import jenkins
j = jenkins.Jenkins('http://your_url_here', 'username', 'password')