使用 Windows 身份验证访问 R 中的共享点

编程入门 行业动态 更新时间:2024-10-22 02:43:24
本文介绍了使用 Windows 身份验证访问 R 中的共享点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试从我公司的 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 中的共享点

本文发布于:2023-11-16 18:33:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606774.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:身份验证   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!