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?
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. Seems Request 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
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.
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
<authentication mode="Forms">
<forms name="AuthCookie" path="/"></forms>
</authentication>
and the application under it had a web.config under that looked like this
<authentication mode="Forms">
<forms name="WRONGCOOKIENAME" path="/"></forms>
</authentication>
The application had web form with a constructor that looked like this
[PrincipalPermissionAttribute(SecurityAction.Demand, Role = "Foo", Authenticated = true)]
So it required authentication but it didn't have it because the cookie name was wrong. Fixing the cookie name resolved the error.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With