I'm trying to implement Forms Authentication in ASP.NET MVC4 application and I've only one user who is going to get authenticated to do some admin activities.
<authentication mode="Forms">
<forms timeout="2880" loginUrl="~/Admin/Login" slidingExpiration="true">
<credentials passwordFormat="Clear">
<user name="user" password="password"/>
</credentials>
</forms>
</authentication>
When I try to use the FormsAuthentication.ValidateUser
method I get an obsolete warning and I'm supposed to use now Membership
class.
My question is how I can configure membership provider in web.config to use the credentials setup in the web.config? What provider I should specify in the name
attribute?
Unfortunately, there is no built-in membership provider for the mechanism of storing the credentials in the web.config as you describe. You could write your own to invoke the FormsAuthentication.Authenticate method or call this from your own custom login control's code-behind.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With