C# 使用存储的windows凭据而不是当前用户进行身份验证登录
我有一个asp.net站点,它根据用户当前的windows登录对用户进行身份验证,如下所示C# 使用存储的windows凭据而不是当前用户进行身份验证登录,c#,asp.net,iis,authentication,C#,Asp.net,Iis,Authentication,我有一个asp.net站点,它根据用户当前的windows登录对用户进行身份验证,如下所示 WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent()); FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(username, false, Session.Timeout); string sEncTicket = Fo
WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(username, false, Session.Timeout);
string sEncTicket = FormsAuthentication.Encrypt(ticket);
string redirectUrl = FormsAuthentication.GetRedirectUrl(username, false);
除非在本地系统的凭证保险库中存储了不同的用户名/密码组合,否则此操作非常有效,此时存储的凭证将作为登录凭证传递
更困难的是,如果我尝试在保存了存储凭据的情况下在VS中进行调试,则会正确地传递当前登录的用户名
以前有没有人遇到过这个问题&如果是的话,我怎么能做到
谢谢为什么不直接使用Windows身份验证而不是表单?对于延迟回复,凯恩深表歉意-要求最终用户可以选择表单或Windows身份验证