Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4102452
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:49:44+00:00 2026-05-20T20:49:44+00:00

I am getting results always invalidpassword . I am always passing for all users

  • 0

I am getting results always invalidpassword. I am always passing for all users Password="mypassword". It is default

Membership.CreateUser(Constitid, Password, Email, question, Status, true, out result);

In web.config file:

<add name="AspNetSqlMembershipProvider" 
     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     connectionStringName="LocalSqlServer"
     enablePasswordRetrieval="false" 
     enablePasswordReset="true"
     requiresQuestionAndAnswer="true" 
     applicationName="/"
     requiresUniqueEmail="false"
     passwordFormat="Hashed" 
     maxInvalidPasswordAttempts="5"
     minRequiredPasswordLength="7" 
     minRequiredNonalphanumericCharacters="0" 
     passwordAttemptWindow="10"
     passwordStrengthRegularExpression="" />

Passing simple password will not work? how to solve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:49:44+00:00Added an answer on May 20, 2026 at 8:49 pm

    After disassembling SqlMembershipProvider, it throws InvalidPassword in following cases – marked with **

    my guess – check whether you override MembershipProvider.ValidatingPassword Event

      public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
    {
        string str3;
        MembershipUser user;
        if (!SecUtility.ValidateParameter(ref password, true, true, false, 0x80))
        {
            status = **MembershipCreateStatus.InvalidPassword**;
            return null;
        }
        string salt = this.GenerateSalt();
        string objValue = this.EncodePassword(password, (int) this._PasswordFormat, salt);
        if (objValue.Length > 0x80)
        {
            status = **MembershipCreateStatus.InvalidPassword**;
            return null;
        }
        if (passwordAnswer != null)
        {
            passwordAnswer = passwordAnswer.Trim();
        }
        if (!string.IsNullOrEmpty(passwordAnswer))
        {
            if (passwordAnswer.Length > 0x80)
            {
                status = MembershipCreateStatus.InvalidAnswer;
                return null;
            }
            str3 = this.EncodePassword(passwordAnswer.ToLower(CultureInfo.InvariantCulture), (int) this._PasswordFormat, salt);
        }
        else
        {
            str3 = passwordAnswer;
        }
        if (!SecUtility.ValidateParameter(ref str3, this.RequiresQuestionAndAnswer, true, false, 0x80))
        {
            status = MembershipCreateStatus.InvalidAnswer;
            return null;
        }
        if (!SecUtility.ValidateParameter(ref username, true, true, true, 0x100))
        {
            status = MembershipCreateStatus.InvalidUserName;
            return null;
        }
        if (!SecUtility.ValidateParameter(ref email, this.RequiresUniqueEmail, this.RequiresUniqueEmail, false, 0x100))
        {
            status = MembershipCreateStatus.InvalidEmail;
            return null;
        }
        if (!SecUtility.ValidateParameter(ref passwordQuestion, this.RequiresQuestionAndAnswer, true, false, 0x100))
        {
            status = MembershipCreateStatus.InvalidQuestion;
            return null;
        }
        if ((providerUserKey != null) && !(providerUserKey is Guid))
        {
            status = MembershipCreateStatus.InvalidProviderUserKey;
            return null;
        }
        if (password.Length < this.MinRequiredPasswordLength)
        {
            status = **MembershipCreateStatus.InvalidPassword**;
            return null;
        }
        int num = 0;
        for (int i = 0; i < password.Length; i++)
        {
            if (!char.IsLetterOrDigit(password, i))
            {
                num++;
            }
        }
        if (num < this.MinRequiredNonAlphanumericCharacters)
        {
            status = **MembershipCreateStatus.InvalidPassword**;
            return null;
        }
        if ((this.PasswordStrengthRegularExpression.Length > 0) && !Regex.IsMatch(password, this.PasswordStrengthRegularExpression))
        {
            status = **MembershipCreateStatus.InvalidPassword**;
            return null;
        }
        ValidatePasswordEventArgs e = new ValidatePasswordEventArgs(username, password, true);
        this.OnValidatingPassword(e);
        if (e.Cancel)
        {
            status = **MembershipCreateStatus.InvalidPassword**;
            return null;
        }
        try
        {
            SqlConnectionHolder connection = null;
            try
            {
                connection = SqlConnectionHelper.GetConnection(this._sqlConnectionString, true);
                this.CheckSchemaVersion(connection.Connection);
                DateTime time = this.RoundToSeconds(DateTime.UtcNow);
                SqlCommand command = new SqlCommand("dbo.aspnet_Membership_CreateUser", ....
    
                command.Parameters.Add(parameter);
                try
                {
                    command.ExecuteNonQuery();
                }
                catch (SqlException exception)
                {
                    if (((exception.Number != 0xa43) && (exception.Number != 0xa29)) && (exception.Number != 0x9d0))
                    {
                        throw;
                    }
                    status = MembershipCreateStatus.DuplicateUserName;
                    return null;
                }
                int num3 = (parameter.Value != null) ? ((int) parameter.Value) : -1;
                if ((num3 < 0) || (num3 > 11))
                {
                    num3 = 11;
                }
                status = (MembershipCreateStatus) num3;
                if (num3 != 0)
                {
                    return null;
                }
                providerUserKey = new Guid(command.Parameters["@UserId"].Value.ToString());
                time = time.ToLocalTime();
                user = new MembershipUser(this.Name, username, providerUserKey, email, passwordQuestion, null, isApproved, false, time, time, time, time, new DateTime(0x6da, 1, 1));
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                    connection = null;
                }
            }
        }
        catch
        {
            throw;
        }
        return user;
    }
    
    
    internal static bool ValidateParameter(ref string param, bool checkForNull, bool checkIfEmpty, bool checkForCommas, int maxSize)
    {
        if (param == null)
        {
            return !checkForNull;
        }
        param = param.Trim();
        return (((!checkIfEmpty || (param.Length >= 1)) && ((maxSize <= 0) || (param.Length <= maxSize))) && (!checkForCommas || !param.Contains(",")));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting odd results from a MySQL SELECT query involving a LEFT JOIN ,
I know this is usually done with cookies, but I am getting unpredictable results
I'm getting some confusing results around myCustom.ashx handler. If i visit the handler via
Ok so I thought it was fixed, but I'm getting totally inconsistent results. I
Has anybody had any success getting Team Build to show xUnit.net test results and
I'm new to LINQ and am having a problem getting proper results from a
I'm trying to detect the speed of touch movement and i'm not always getting
Is there a better way of getting this result? This function fails if num
I am getting Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
Getting the subdomain from a URL sounds easy at first. http://www.domain.example Scan for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.