我正在尝试从我公司的 Intranet 共享点读取数据.
require(httr)url <- "//_vti_bin/ListData.svc/"r <- GET(url)问题是,对 Sharepoint 的访问使用 Windows 身份验证.预计上述内容给了我 401 Unauthorized 错误.
如何将我的 Windows 身份验证合并到 R 中的请求中,而无需在 GET 参数中以明文形式输入我的凭据?(使用 authenticate() 和我的凭据确实有效).
解决方案按照概述获取您的站点 ID 此处.按照概述获取您的列表 ID 这里.如果您需要展开任何列表项,请检查 这个出来.
为了确保您不会像我一样脱发和秃顶,请确保您在 SharePoint 网站中的项目级读取权限设置为读取所有项目".(这里是参考).
库(AzureGraph)gr <- create_graph_login()我 <- gr$get_user("me")url <- "graph.microsoft/v1.0/sites/{site-id}/lists/{list-id}/items"r <- call_graph_url(me$token, url, http_verb = c(GET"))I am trying to read data from my company intranet sharepoint.
require(httr) url <- "<domain>/<path>/_vti_bin/ListData.svc/<something>" r <- GET(url)The problem is, access to Sharepoint uses Windows authentication. The above, expectedly, gave me 401 Unauthorized error.
How can I incorporate my windows authentication into the request in R, without typing my credential in clear text in the GET parameter? (using authenticate() with my credentials do work).
解决方案Get your site-id as outlined here. Get your list-id as outlined here. If you need to expand any list items, check this out.
And to make sure you don't pull your hair out and go bald like me, make sure that your item-level permissions for read access in the SharePoint site are set to "Read all items" (here's a reference).
library(AzureGraph) gr <- create_graph_login() me <- gr$get_user("me") url <- "graph.microsoft/v1.0/sites/{site-id}/lists/{list-id}/items" r <- call_graph_url(me$token, url, http_verb = c("GET"))
更多推荐
使用 Windows 身份验证访问 R 中的共享点
发布评论