SSPI-Error when impersonating to a fixed server account in ASP

G

Guest

System.Security.Cryptography.Utils._CreateCSP throws a
System.Security.Cryptography.CryptographicException with the message "file
not found" when we impersonate IIS5 to a fixed account from web.config. If we
let it run under the ASPNET user things are fine.

does anyone have an idea what goes wrong here?

web.config:
<identity userName="server_account" password="password"/>

default.aspx (to verify the error):
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Security.Cryptography;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
using (RSA rsa = RSA.Create())
{
string a = rsa.ToXmlString(false);
Label1.Text = "succeeded: " + a;
}
}
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top