System.Security.SecurityException:主体权限请求失败
任何人都可以帮助我指出如何修复此错误的正确方向吗?
System.Web.Services.Protocols.SoapException: Server was unable to process request.
---> System.Security.SecurityException: Request for principal permission failed.
at System.Security.Permissions.PrincipalPermission.ThrowSecurityException()
at System.Security.Permissions.PrincipalPermission.Demand()
at System.Security.PermissionSet.DemandNonCAS()
at LiveDocx.MailMerge.SetLocalTemplate(String template, String format)
我已经安装了我公司从 LiveDocx 购买的这个软件。所以,我没有能力修改代码,甚至没有能力阅读代码。我已经根据他们的文档安装了所有内容,并且该网站已确认可以正常工作。我只能更改 IIS、文件夹权限和 Web.config 中的设置。我们的服务器,他们的软件。
现在,我在保持登录网络服务时遇到问题。在您认为它是肥皂客户端之前,我已经通过调用供应商的服务器确认它可以工作。
在本地,我可以在登录期间成功调用 Web 服务,并且工作正常。但是,当我进行后续调用时,我收到请求主体权限失败
。
应他们技术支持的要求,我已将
添加到 web.config,但这不起作用。现在,他们已经停止回复我们的电子邮件。
我不是 ASP.NET 开发人员,因此我对服务器设置的了解有限。有人可以指出为什么会发生此错误的正确方向以及解决此问题的一些地方吗?
Can anyone help point me in the right direction of how I might be able to fix this error?
System.Web.Services.Protocols.SoapException: Server was unable to process request.
---> System.Security.SecurityException: Request for principal permission failed.
at System.Security.Permissions.PrincipalPermission.ThrowSecurityException()
at System.Security.Permissions.PrincipalPermission.Demand()
at System.Security.PermissionSet.DemandNonCAS()
at LiveDocx.MailMerge.SetLocalTemplate(String template, String format)
I have installed this software that my company purchased from LiveDocx. So, I don't have ability to modify code or even read the code. I have installed everything according to their documentation and the site is confirmed to work. I can only change settings in IIS, folder permissions, and Web.config. Our server, their software.
Now, I am having issue with staying logged into the webservice. Before you think it is the soap client, I have confirmed that it works by calling the vendor's servers.
Locally, I can successfully call the web service during login and it works fine. However, when I make a subsequent call, I get the Request for principal permission failed
.
At the request of their technical support, I have added <trust level="Full" />
to the web.config, but that didn't work. Now, they have stopped replying to our emails.
I am not an ASP.NET developer, so my knowledge is limited on server settings. Can someone point me in the right direction why this error happens and a few places to look to resolve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我终于找到了解决办法。这个关于权限的错误有点误导。经过大量的试验和错误,我终于接受了应用程序池用户的权限与这个问题无关。这导致我调查了
web.config
设置,这就是我发现问题的地方。问题是提供的
web.config
文件缺少
标记和所需的设置。这个标签(根据我的理解)是启用cookie的。我希望这可以帮助其他人解决此错误,即使与 LiveDocx 无关。似乎请求主体权限失败。
可能由多种原因引起,这使其成为令人沮丧的错误。本文非常有帮助如何:在 ASP.NET 2.0 中使用成员身份
I finally found a solution. This error about permissions is a bit misleading. After lots of trial and errors, I finally accepted the Application Pool user's permissions had nothing to do with this problem. Which lead me to investigate the
web.config
settings and that is where I found the problem.The problem was that the supplied
web.config
file was missing<authentication>
tag and the required settings. This tag (from my understanding) is what enables cookies. I hope this helps others with this error even if not related to LiveDocx. SeemsRequest for principal permission failed.
can be caused for various reasons which makes it a frustrating error.This article was very helpful How To: Use Membership in ASP.NET 2.0
我怀疑正在执行请求的用户的身份,该用户很可能是运行 IIS 应用程序的网站的 ASP.Net 应用程序池用户。
测试这一点的最简单方法是创建一个新的应用程序池您的 IIS 应用程序(除非当前应用程序池中没有其他应用程序),为应用程序池选择不同的标识(您可以从网络服务开始,但它可能需要本地用户),然后将您的应用程序分配到该池。
这应该告诉您应用程序池身份是否存在权限问题。
I would suspect the identity of the user that is executing the request, which is most likely the ASP.Net Application Pool user for the web site your IIS application is running in.
The easiest way to test this is to create a new application pool for your IIS application (unless there are no other apps in your current app pool), choose a different identity for the app pool (you could start with network service, but it may require a local user), then assign your app to that pool.
This should tell you if it's a permissions problem with the app pool identity.
我遇到这个问题是因为我在网站下有一个应用程序配置为使用错误的 cookie 名称。
我的根网站的 web.config 看起来像这样
,它下面的应用程序有一个 web.config,看起来像这样
该应用程序有一个带有构造函数的 Web 表单,看起来像这样
所以它需要身份验证,但它没有它因为cookie名称错误。修复 cookie 名称解决了该错误。
I ran into this because I had an application under a website configured to use the wrong cookie name.
The web.config at my root web site looked like this
and the application under it had a web.config under that looked like this
The application had web form with a constructor that looked like this
So it required authentication but it didn't have it because the cookie name was wrong. Fixing the cookie name resolved the error.
我遇到了类似的问题,我正在使用表单应用程序并不断遇到此问题。我还使用了校长许可和安全行动要求。
我尝试了所有与 web.config 相关的设置,最后的问题是应用程序池。
如果您要将应用程序从 WinXP 迁移到 Win7 和其他更高版本,您可能会看到有一个托管管道,默认情况下将网站指向集成模式。我将其更改为经典模式,这解决了问题。希望这对尝试将应用程序从 WinXp 迁移到 Win7 的会员有所帮助
I had a similar issue and I was using a forms application and keep on getting this issue. I was also using Principal permission and Security Action Demand.
I tried all the web.config related settings and the final issue was with the application pool.
If you are having the application migrated from WinXP to Win7 and other higher version you might see there is a Managed Pipeline which is by default pointing the website to Intergrated mode. I changed this to classic mode which has fixed the issue. Hopefully this would help the members who are trying to move the application from WinXp to Win7
经过大量尝试和错误阅读所有博客和答案的帖子,我仍然无法解决它。
最后,我怀疑我的项目中的事情。
我们是 DevExpress 产品,几天前就过期了,所以根据我的假设,它应该是许可的,所以我们购买了相同的许可证,现在它已经开始正常工作了。
PS:如果您使用任何许可产品,您也可能会收到此错误。因此,还要检查许可证。
After lot of trial and error with respective of reading all blogs and answer's post, i was still not able to resolve it.
Finally, I suspect on thing in my Project.
We are DevExpress product which got expired before some days, So as per my assumption it should be Licensed as so we purchased the license for the same now it's started working normally.
P.S.: If you're using any Licensed Product, You might get this error as well. So do also check about License.