public static bool ResetPassword(string passwordResetToken, string newPassword) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this return(provider.ResetPasswordWithToken(passwordResetToken, newPassword)); }
public static bool ConfirmAccount(string userName, string accountConfirmationToken) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this return(provider.ConfirmAccount(userName, accountConfirmationToken)); }
public static string CreateUserAndAccount( string userName, string password, object propertyValues = null, bool requireConfirmationToken = false ) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this IDictionary <string, object> values = propertyValues as RouteValueDictionary; if (values == null && propertyValues != null) { var propertyValuesAsDictionary = propertyValues as IDictionary <string, object>; if (propertyValuesAsDictionary != null) { values = new RouteValueDictionary(propertyValuesAsDictionary); } else { values = new RouteValueDictionary(propertyValues); } } return(provider.CreateUserAndAccount( userName, password, requireConfirmationToken, values )); }
public static DateTime GetLastPasswordFailureDate(string userName) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this return(provider.GetLastPasswordFailureDate(userName)); }
public static int GetPasswordFailuresSinceLastSuccess(string userName) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this return(provider.GetPasswordFailuresSinceLastSuccess(userName)); }
public static bool IsConfirmed(string userName) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this return(provider.IsConfirmed(userName)); }
public static int GetUserIdFromPasswordResetToken(string token) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this return(provider.GetUserIdFromPasswordResetToken(token)); }
public static bool IsAccountLockedOut(string userName, int allowedPasswordAttempts, TimeSpan interval) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this return(IsAccountLockedOutInternal(provider, userName, allowedPasswordAttempts, interval)); }
public static string GeneratePasswordResetToken(string userName, int tokenExpirationInMinutesFromNow = 1440) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this return(provider.GeneratePasswordResetToken(userName, tokenExpirationInMinutesFromNow)); }
public static string CreateAccount(string userName, string password, bool requireConfirmationToken = false) { ExtendedMembershipProvider provider = VerifyProvider(); Debug.Assert(provider != null); // VerifyProvider checks this return(provider.CreateAccount(userName, password, requireConfirmationToken)); }
private static ExtendedMembershipProvider VerifyProvider() { ExtendedMembershipProvider provider = Membership.Provider as ExtendedMembershipProvider; if (provider == null) { throw new InvalidOperationException(WebDataResources.Security_NoExtendedMembershipProvider); } provider.VerifyInitialized(); // Have the provider verify that it's initialized (only our SimpleMembershipProvider does anything here) return(provider); }
internal static bool IsAccountLockedOutInternal( ExtendedMembershipProvider provider, string userName, int allowedPasswordAttempts, TimeSpan interval ) { return( provider.GetUser(userName, false) != null && provider.GetPasswordFailuresSinceLastSuccess(userName) > allowedPasswordAttempts && provider.GetLastPasswordFailureDate(userName).Add(interval) > DateTime.UtcNow ); }
internal static bool IsAccountLockedOutInternal(ExtendedMembershipProvider provider, string userName, int allowedPasswordAttempts, TimeSpan interval) { return (provider.GetUser(userName, false) != null && provider.GetPasswordFailuresSinceLastSuccess(userName) > allowedPasswordAttempts && provider.GetLastPasswordFailureDate(userName).Add(interval) > DateTime.UtcNow); }