Siteminder excel vba身份验证

Siteminder excel vba身份验证,vba,rest,jira,siteminder,Vba,Rest,Jira,Siteminder,我需要使用jira Rest API获取excel工作表中的某些内容。问题是服务器启用了siteminder。我使用此codeproject文章作为参考(),但仍然无法访问siteminder登录页面 作为参考,我的代码如下: Dim http As New WinHttp.WinHttpRequest http.Option(WinHttpRequestOption_EnableRedirects) = False url = "http://example.com" ' Launch the

我需要使用jira Rest API获取excel工作表中的某些内容。问题是服务器启用了siteminder。我使用此codeproject文章作为参考(),但仍然无法访问siteminder登录页面 作为参考,我的代码如下:

Dim http As New WinHttp.WinHttpRequest
http.Option(WinHttpRequestOption_EnableRedirects) = False
url = "http://example.com"
' Launch the HTTP request
http.Open "GET", url, False
http.Send
target=http.GetResponseHeaders("location")//get the target url for post
Cookie=""
postData="USER="&HttpUtility.UrlEncode(username)&"&PASSWORD="&password
http.Open "POST", target, False
http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
http.setRequestHeader "Cookie", Cookie
http.Send postData

第一个http请求将我带到siteminder的userlogin页面,但用户在post请求后未获得身份验证。我收到错误登录页面。关于如何获得用户身份验证的建议?

您指向的链接是一篇VB.NET文章。所以你需要使用。您还应该发布您尝试过的内容。代码如下:将http设置为新的WinHttp.WinHttpRequest http.Option(WinHttpRequestOption_EnableRedirects)=False url=“””启动http请求http。打开“GET”,url,False http。发送目标=http.GetResponseHeaders(“location”)//获取post Cookie的目标url=“”postData=“USER=”&HttpUtility.UrlEncode(username)和“&PASSWORD=“&PASSWORD http.Open“POST”,target,False http.setRequestHeader”Content Type,“application/x-www-form-urlencoded”http.setRequestHeader“Cookie”,Cookie http。发送postdata您应该回答问题,而不是添加答案