我正在尝试从公司网络中的Windows(sharepoint 2007)Web服务器访问URL。我正在使用R和curl,但似乎无法获得授权部分。 (我和Web服务器之间没有代理或防火墙,而且我在同一域的Windows机器上)这就是我目前所拥有的;
library(SSOAP)
library(XML)
library(RCurl)
#This works fine for a page with no authroisation required
y = tryCatch(getURLContent("http://www.example.com/webpagewithnoauthroisation.html",
verbose=TRUE,
httpauth="ntlm", userpwd="DOMAIN/username:password"),
HTTPError = function(e) {
cat("HTTP error: ", e$message, "\n")
})
#This fails for a page that needs authoisation
x = tryCatch(getURLContent("http://sharepoint.example.com/Pages/Default.aspx",
verbose=TRUE,
httpauth="ntlm", userpwd="DOMAIN/username:password"),
HTTPError = function(e) {
cat("HTTP error: ", e$message, "\n")
})
> Error: Unauthorized
我有点难过如何调试(在我的Windows机器上)。有关调试(r)卷曲身份验证问题的任何好建议吗?
编辑:我认为这将是NTLM,但刚刚读到它可能是其他东西(Kerberos?)。目标Web服务器是Sharepoint 2007服务器。