title: How do you extend the SimpleMembership authentication in ASP.NET MVC4
body: <p>I've done several ASP.NET MVC 1 and 2 sites. Somehow I managed to skip v3. 
  I'm now creating a new ASP.NET MVC 4 site and I see that all the Membership stuff has changed completely.</p>
  
  <p>At first I was happy. It looked easy to setup and use and the Internet project template came with all the classes and views I needed to get started.</p>
  
  <p>Unfortunately, I'm now completely stuck. I need extend the code that authenticates a user. Basically, I need to authenticate some users against a web service and other users against the local database. Both types of users will have profile data stored in the local database.</p>
  
  <p>My problem is that I can't find any way extending SimpleMembership. </p>
  
  <p>Under the old Membership provider model, I would have taken a stab at inheriting from SqlMembership and overriding ValidateUser() and calling the base class or calling the web service.</p>
  
  <p>I did try doing something like that my creating a class in my project that inherites from SimpleMembership and then configuring it as the default membership provider in web.config, but that just gave me the error</p>
  
  <pre><code>Parser Error Message: This method cannot be called during the application's pre-start initialization phase.
  
  Line 32:     &lt;membership defaultProvider="ssund"&gt;
  Line 33:       &lt;providers&gt;
  Line 34:         &lt;add name="ssund" type="Ssund.Web.Providers.SsundSimpleMembershipProvider"/&gt;
  Line 35:       &lt;/providers&gt;
  Line 36:     &lt;/membership&gt;
  </code></pre>