加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

使用Windows身份验证访问R中的sharepoint

发布时间:2020-12-14 02:47:02 所属栏目:Windows 来源:网络整理
导读:我正在尝试从我公司的Intranet sharepoint读取数据. require(httr)url - "http://domain/path/_vti_bin/ListData.svc/something"r - GET(url) 问题是,访问Sharepoint使用Windows身份验证.以上,预计会给我401 Unauthorized错误. 如何将我的Windows身份验证合
我正在尝试从我公司的Intranet sharepoint读取数据.

require(httr)
url <- "http://<domain>/<path>/_vti_bin/ListData.svc/<something>"
r <- GET(url)

问题是,访问Sharepoint使用Windows身份验证.以上,预计会给我401 Unauthorized错误.

如何将我的Windows身份验证合并到R中的请求中,而无需在GET参数中以明文形式键入我的凭据? (使用带有我的凭据的authenticate()可以正常工作).

解决方法

authenticate()是正确使用的函数,但您需要更改输入,如下所示:

require(httr)
url <- "http://<domain>/<path>/_vti_bin/ListData.svc/<something>"
r <- GET(url,authenticate("username","password",type="any"))

我不确定哪种特定类型有效,但我能够使用any建立会话.我在httr包文档中找到了解决方案.

https://cran.r-project.org/web/packages/httr/httr.pdf

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读