我已经设置了IIS服务器以要求客户端证书。但浏览器从不询问用户,即使IE已启用“不提示客户端证书选择时,它也直接发送客户端证书信息”
我的代码或IIS中有什么事吗?
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Welcome.Text = "Hello, " + Context.User.Identity.Name;
string userName;
userName = User.Identity.Name;
HttpClientCertificate cert = Request.ClientCertificate;
if (cert.IsPresent)
certDataLabel.Text = cert.Issuer;
else
certDataLabel.Text = "No certificate was found.";
}
protected void Signout_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("Logon.aspx");
}
}