Invoking jenkins remotely with the user context

13 views
Skip to first unread message

Badal Kotecha

unread,
Oct 13, 2018, 9:00:44 PM10/13/18
to Jenkins Users
Is there a way to invoke Jenkins job remotely considering below scenario

Jenkins is enabled for authentication and authorization against azure AD using Azure AD Plugin
I have a simple web application which also is enabled for azure AD authentication
This web application is responsible to invoke or trigger a job remotely but in the context of the currently logged in user (to the website)
I know we can invoke the Jenkins job with user and API token but how do we get the Jenkins API token dynamically for the current user logged in to the website. Or is there any other way to just pass the ID token and invoke the job over HTTP REST endpoint

Regards
Badal

Robert Simple

unread,
Oct 25, 2018, 3:41:25 AM10/25/18
to Jenkins Users
Hi Badal,

i am struggling exactly with the same thing here - and haven't found a solution yet. 

As a temporary fix, (which i dislike very much) i have special user configured in AD - and since all request are going through the servlet, that user credentials are stored on a server in a separate config file, and are used each time during request to jenkins json api. 
This temp solution is fine to query info (e.g. get job lists, statuses, definitions etc) but when it comes down to running a job it is bad, since i want to see what job was triggered by what user. 

Please if you find a solution let me know. 

cheers,
Rob
Reply all
Reply to author
Forward
0 new messages