使用基于表单的身份验证修改 SharePoint 应用程序 Web.config 文件 [英] Modifying SharePoint app Web.config file with Forms Based Authentication

查看:29
本文介绍了使用基于表单的身份验证修改 SharePoint 应用程序 Web.config 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 SharePoint 应用程序,我们希望用户能够通过激活功能来修改 web.config.该应用程序已扩展,因此我们有一个基于 AD 的 Web 应用程序和另一个使用基于表单的身份验证 (FBA) 的应用程序,其中 FBA 应用程序是主要"用户应用程序.

We have a SharePoint application where we want the user to be able to modify the web.config by activating a feature. The application is extended, so we have an AD based web application and another that uses Forms Based authentication (FBA), with the FBA application being the "main" user application.

我们使用 SPWebConfigModification 类 (http:///msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebconfigmodification.aspx) 写入 web.config 以获取激活功能所需的设置.

We use the SPWebConfigModification class (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebconfigmodification.aspx) to write to the web.config for settings we need for the activated feature.

这在基于 AD 的方面非常有效.但是,当我们尝试在基于 FBA 的 Web 应用程序上运行此应用程序时,我们会收到错误消息,因为 FBA 站点的站点集管理员无权修改服务器上的 web.config.鉴于他们是 FBA 用户,我们也无法授予他们在服务器上的权限.

This works great on the AD based side of things. However, when we try and run this on the FBA based web app, we get an error because the site collection administrator for the FBA site, does not have any access to modify the web.config on the server. Given that they are a FBA user, we can not give them rights on the server either.

有人遇到过这种情况吗?有没有人有任何解决方法.我假设我可以尝试让应用程序通过命令行运行来更新 web.conifg,但我真的希望用户在激活该功能时完成它.我也可以尝试放松 web.config 上的安全权限,但这是一个糟糕的开始.

Has anyone run into this? Does anyone have any work arounds. I assume I could try and have the application to update the web.conifg run via the command line, but I would really like it be done by the user when they activate the feature. I could also try and loosen security rights on the web.config, but that is a bad path to start down.

谢谢!约翰

推荐答案

另一种方法是编写一个组件来完成它.这可以通过激活功能或更新 webpart 来触发.

An alternative would be to write a component which does it. This could be trigged by activating a feature, or updating a webpart.

这意味着您不需要放松安全性,也不需要通过命令行来实现.

This would mean you don't need to loosen security, or do it via the command line.

这篇关于使用基于表单的身份验证修改 SharePoint 应用程序 Web.config 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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