验证MembershipUser而不需要密码



是否可以在没有密码的情况下验证MembershipUser ?我有猜测的用户帐户,其中有临时密码,但我不需要这些用户实际登录。我想自动验证他们的userid。

这能做到吗?

FormsAuthentication.SetAuthCookie(publicuser.UserName, false); 

似乎实际上并没有根据会员资格提供程序对它们进行身份验证。

您可以覆盖在System.ServiceModel.DomainServices.Server.ApplicationServices:

中定义的ValidateUser:
protected override bool ValidateUser(string userName, string password)

然后你可以检查

if ( IsAGuestAccount( userName ) ) return true;

最新更新