我可以使用__requestdigest在CSOM上下文中进行身份验证吗? [英] Can i authenticate in CSOM context using the __requestdigest?

查看:110
本文介绍了我可以使用__requestdigest在CSOM上下文中进行身份验证吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个web api来将数据放入SharePoint列表中,并使用javascript在SharePoint页面中使用此api,但所有操作都与web api应用程序池的用户配合使用。我可以传递__requestdigest来验证CSOM上下文吗?如果没有,
我该怎么办?

I developed a web api to put data in SharePoint lists, and consume this api in SharePoint pages using javascript, but all actions are maked with the web api application pool's user. Can i pass the __requestdigest to authenticate on CSOM context? If not, how can i do it? 

推荐答案

没有请求摘要,但您可以在web.config中存储服务帐户名和密码您的web api服务和使用此服务帐户验证ClientContext调用,如图所示这里:

在Sharepoint Online中枚举所有租户的网站集通过PowerShell
。或者(在我的观点中更可取)您可以注册新的Sharepoint应用程序(通过appregnew.aspx页面),授予此应用程序的权限(通过appinv.aspx页面),并使用app
仅使用客户端上下文应用的权限。
not with request digest, but you may store service account name and password in web.config of your web api service and authenticate ClientContext call using this service account like shown e.g. here: Enumerate all tenant’s site collections in Sharepoint Online via PowerShell. Alternatively (and preferable in my point of view) you may register new Sharepoint app (via appregnew.aspx page), give permissions to this app (via appinv.aspx page), and use app only client context which will use app's permissions.


这篇关于我可以使用__requestdigest在CSOM上下文中进行身份验证吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆