我有一个SL4 LOB应用程序,它仅使用RIA服务进行身份验证(到目前为止)。
我使用默认的提供商和服务,并添加了少量内容(见下文)。
网络连接速度较慢的一些用户抱怨他们的登录时间超时,错误:
Load operation failed for query 'Login'.
[HttpRequestTimedOutWithDetail]
我的连接登录正常。
所以,
MyCustomMembershipProvider:
public class MyCustomMembershipProvider : SqlMembershipProvider
{
public override MembershipUser CreateUser(string username, string password,
string email, string passwordQuestion, string passwordAnswer, bool isApproved,
object providerUserKey, out MembershipCreateStatus status)
{
var newUser = base.CreateUser(username, password, email, passwordQuestion,
passwordAnswer, false, providerUserKey, out status);
if (newUser != null)
{
SendEmailToAdminForApproval(newUser);
}
return newUser;
}
private void SendEmailToAdminForApproval(MembershipUser user)
{
// Send a mail here
}
}
并且,AuthenticationService:
[EnableClientAccess]
public class AuthenticationService : AuthenticationBase<User>
{
public List<User> GetUsers()
{
return System.Web.Security.Membership.GetAllUsers().Cast<User>().ToList();
}
}