コード例 #1
0
        internal AuthenticationStatus ResetPassword(int requestId, string password)
        {
            try
            {
                if (PasswordResetRequest == null)
                {
                    return(AuthenticationStatus.ResetRequestNotFound);
                }
                else if (PasswordResetRequest.RequestId != requestId)
                {
                    return(AuthenticationStatus.Failed);
                }
                else if ((DateTime.UtcNow - PasswordResetRequest.RequestTime).TotalHours > Configuration.AllowedPasswordResetHoursSkew)
                {
                    return(AuthenticationStatus.RequestIsTooOld);
                }

                PasswordHash = password.GetPasswordHash();
                return(AuthenticationStatus.Success);
            }
            finally
            {
                PasswordResetRequest = null;
            }
        }
コード例 #2
0
 internal int RequestPasswordReset()
 {
     PasswordResetRequest = new PasswordResetRequest();
     return(PasswordResetRequest.RequestId);
 }