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.
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.
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.
My problem is that I can't find any way extending SimpleMembership.
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.
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
Parser Error Message: This method cannot be called during the application's pre-start initialization phase.
Line 32: <membership defaultProvider="ssund">
Line 33: <providers>
Line 34: <add name="ssund" type="Ssund.Web.Providers.SsundSimpleMembershipProvider"/>
Line 35: </providers>
Line 36: </membership>