C# 在没有密码的情况下验证MembershipUser?

C# 在没有密码的情况下验证MembershipUser?,c#,asp.net-membership,forms-authentication,formsauthenticationticket,C#,Asp.net Membership,Forms Authentication,Formsauthenticationticket,是否可以在没有密码的情况下对MembershipUser进行身份验证。我有gues用户帐户,并且有临时密码,但是我不要求这些用户实际登录。我想根据他们的用户ID自动对他们进行身份验证 这能做到吗 FormsAuthentication.SetAuthCookie(publicuser.UserName, false); 似乎没有针对memebrship提供程序对其进行实际身份验证。您可以覆盖System.ServiceModel.DomainServices.Server.Applicati

是否可以在没有密码的情况下对MembershipUser进行身份验证。我有gues用户帐户,并且有临时密码,但是我不要求这些用户实际登录。我想根据他们的用户ID自动对他们进行身份验证

这能做到吗

FormsAuthentication.SetAuthCookie(publicuser.UserName, false); 

似乎没有针对memebrship提供程序对其进行实际身份验证。

您可以覆盖System.ServiceModel.DomainServices.Server.ApplicationServices中定义的ValidateUser:

protected override bool ValidateUser(string userName, string password)
那你可以查一下


if(IsAGuestAccount(userName))返回true

为什么需要根据成员资格提供程序验证用户?为什么SetAuthCookie还不够?