MembershipCreateUserException "The password-answer supplied is invalid."

I am having a difficult time getting past an error.  To start with, I used the Silverlight Business Application template to create the base project and website.  I have made some modifications to the default login forms created.  I did this so people could register with just a username, email address, and password.  This required a number of changes in various spots.  For instance, I edited the RegistrationData.vb file that was generated in the server project in the Models folder.  This altered the registration xaml child window.  I also modified the UserRegistrationService.vb file in the server project services folder so the Membership.CreateUser method so it was only taking the arguments for username, password, and email address.  I also wanted to eliminate the need for a non alpha numeric character in the password.  Finally, I modified the web.config file to reflect the desired changes.  That section of code is currently looking like:

<membership>
      <providers>
        <remove name="LocalSqlServer"/>
        <add name="ChicagoPartyAnimalsMembershipProvider"
             connectionStringName="LocalSqlServer"
             type="System.Web.Security.SqlMembershipProvider"
             enablePasswordRetrieval="false"
             enablePasswordReset="false"
             requiresQuestionAndAnswer="false"
             applicationName="ChicagoPartyAnimals"
             requiresUniqueEmail="false"
             passwordFormat="Hashed"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="1"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             passwordStrengthRegularExpression=""/>
      </providers>
    </membership>

When I run the project and go to the registration page, I am properly displaying just the 4 fields I desire (username, email, password, confirm password) and when I click the OK button to actually register, I receive the exception listed in the title.  I have tried going through everything with a fine tooth comb to see if I can see what I am missing, although thus far I have been completely stumped.  It is possible/likely that I have modified something else in the effort to remove the security question and answer details as well as the minimum length and character types for the password that has not been listed here.  I just do not understand why I am getting an error related to a security question that is not necessary.  Perhaps my assumption that the error is regarding a security question answer is incorrect???  Regardless, and insight would be greatly appreciated.
The StatusCode of the exception view detail is "MembershipCreateStatus.InvalidAnswer". screen capture of the exception window
tim_chicagopartyanimalsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SameerJagdaleCommented:
can you try with the default one before you start using the custom one?

<system.web>
    <membership>
      <providers>
        <remove name="AspNetSqlMembershipProvider"/>
        <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="false"
             applicationName="/"
             requiresUniqueEmail="false"
             passwordFormat="Hashed"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="1"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             passwordStrengthRegularExpression="" />
      </providers>
    </membership>
  </system.web>

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tim_chicagopartyanimalsAuthor Commented:
That was it, thank you for your help.  From the time the error started until now, things in the web.config file (as well as a few others) slowly evolved and that is something that I didn't even think about or realize.  Your help is greatly appreciated.

Cheers!
0
SameerJagdaleCommented:
glad to hear that :)
0
Zappel89Commented:
I'm afraid the solution doesn't work for me. I still get the "The password-answer supplied is invalid." exception when trying to create a new user with this call:
var newUser = Sitecore.Security.Accounts.User.Create(newMember.Username, newMember.GenerateNewPassword(8));

Open in new window


My default web.config looks like this:
<add name="sql"
type="System.Web.Security.SqlMembershipProvider" 
connectionStringName="core" 
applicationName="sitecore" 
minRequiredPasswordLength="1" 
minRequiredNonalphanumericCharacters="0"
requiresQuestionAndAnswer="false" 
requiresUniqueEmail="true" 
maxInvalidPasswordAttempts="256"/>
        

Open in new window


And I then replaced it with your solution like this:
<membership defaultProvider="sitecore">
      <providers>
        <clear/>
        <add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="sql" providerWildcard="%" raiseEvents="true"/>       
        <add name="sql"
             type="System.Web.Security.SqlMembershipProvider"
             connectionStringName="core"
             enablePasswordRetrieval="false"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="false"
             applicationName="sitecore"
             requiresUniqueEmail="false"
             passwordFormat="Hashed"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="1"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             passwordStrengthRegularExpression="" />
        
        <add name="switcher" type="Sitecore.Security.SwitchingMembershipProvider, Sitecore.Kernel" applicationName="sitecore" mappings="switchingProviders/membership"/>
      </providers>
    </membership>

Open in new window


I really hope you have a solution for this, I have spent so much time on this problem now!

Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.