I am using the built-in SimpleMembership of the ASP.net MVC4 template and want to create an admin panel to reset passwords and similar operations on the user base.
I am using SecurityGuard.MVC4 nuget as starting point and am getting NotSupportedException on most actions. SecurityGuard uses the Membership property of the controller to call methods such as GetAllUsers(), GetUser() and ResetPassword() on SimpleMembershipProvider and they all throw NotSupportedException. From documentation it seems that this is by design:
SimpleMembershipProvider.GetAllUsers
Note: If the SimpleMembershipProvider class has been initialized using a call to the WebSecurity.InitializeDatabaseConnection() method, this method is not supported and will throw a NotSupportedException exception. However, if the WebSecurity.InitializeDatabaseConnection() method has not been called, and if you have configured your site to use the standard ASP.NET membership provider, this method is passed through to the standard membership provider.
What am I missing? It seems I need to choose between using WebSecurity for standard stuff like WebSecurity.CreateUser() and to use the provider directly?
I can work around this, but I am primarily confused on why I can't get both?