Note that there are some explanatory texts on larger screens.

plurals
  1. POSecurity Exception - The application attempted to perform an operation not allowed by the security policy
    primarykey
    data
    text
    <p>I have a simple implementation where I instantiate OpenIdRelyingParty and then call RedirectToProvider. It runs fine in a hosted environment at 1and1 and also on Cassini (Visual Studio 2010). However, when I deploy it onto the IIS on my PC (Windows 7), I get a Security Exception: </p> <blockquote> <p>"<em>The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file</em>." </p> </blockquote> <p>somewhere in the following code:</p> <pre><code>protected void Button1_Click(object sender, ImageClickEventArgs e) { string realm = WebConfigurationManager.AppSettings["Realm"]; Uri returnPath = new Uri(new Uri(realm), "welcome.aspx"); using (OpenIdRelyingParty openId = new OpenIdRelyingParty()) { IAuthenticationRequest request = openId.CreateRequest("https://www.google.com/accounts/o8/id", new DotNetOpenAuth.OpenId.Realm(realm), returnPath); request.RedirectToProvider(); } } </code></pre> <p>The error message is cryptic and the knowledgebase articles on rectifying it are even more so. </p> <ul> <li>Who is attempting to perform what operation? </li> <li>What is DotNetOpenAuth trying to access? </li> <li>Who or what is not trusting who? </li> <li>What is the security policy it is talking about? </li> <li>What is in that policy? </li> <li>Where can I find it or change it?</li> </ul> <p>Thanks.</p> <hr> <p>May 2, 2012</p> <p>As requested, here is the call stack:</p> <pre><code>[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +150 System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100 System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +283 System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet&amp; alteredDemandset, RuntimeMethodHandle rmh) +69 System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh) +150 System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +30 System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +40 System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext) +123 System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant) +54 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload