I have been trying to whip up a quick and dirty application. This application needs to support user authentication. To accomplish this, I thought I could rely on the built in Login control and utilize the credentials ability of the web.config like so:
<authentication mode="Forms">
<forms defaultUrl="/authenticated/menu.aspx" loginUrl="Default.aspx">
<credentials passwordFormat="Clear">
<user name="user1" password="p@ssw0rd" />
</credentials>
</forms>
</authentication>
However, it seems the Login control requires a Membership Provider. I have the following two questions:
- Does a membership provider that works with the web.config exist? if so, where? I haven’t been able to find one?
- Is it possible to login to a web application using the credentials in the web.config?
Thank you!
There’s no built in membership provider for
Web.config. You can manually validate the credentials using the FormsAuthentication.Authenticate method.