authorization headers for jenkins

19 views
Skip to first unread message

ran son

unread,
Jun 28, 2016, 12:10:11 AM6/28/16
to Jenkins Users
Hi 

Im trying to automate job creation from Jenkins using powershell and using BASIC authentication. This works if i use AD auth with "logged in users can do anything " option enable. We had to switch to matrix based security and the BASIC auth no loger works. script below, does anyone know what is the authorixation header that we should set for below request? Any thoughts will be really helpful 


$http_request = New-Object -ComObject Msxml2.XMLHTTP 
        $http_request.open('POST', $url, $false, $username , $password )     
        $http_request.setRequestHeader("Authorization","BASIC $encodedPassword" ) 
        $http_request.setRequestHeader("ACCEPT", "application/xml")     
        #$http_request.setRequestHeader("Content-length", $content.length) 
        $auth_header = "BASIC $encodedPassword" 
        $http_request.setRequestHeader("Connection", "close") 
        $http_request.send($content)
Reply all
Reply to author
Forward
0 new messages