Read xml to web.config for authentication
Hi friends,
For normal authentication, we can use below method in web.config.
<authentication mode="Forms">
<forms name="TestAuthCookie" loginUrl="Default.aspx" timeout="30">
<credentials passwordFormat="Clear">
<user name="user1" password="pass1"/>
<user name="user2" password="pass2"/>
</credentials>
</forms>
Two user name and password i can authenticate in front end. I put multiple user name and password in the xml file. How can i get this xml in web.config file and how check authenticate user in the front end.
Is it possible??
Please reply soon.
Hope ur's reply.
Thanks & Regards
Re: Read xml to web.config for authentication
First, that's bad for security, you shouldn't be placing this kind of information in a config or XML file. Why not use a database?
Second, you can get some nodes in a web.config file to reference external files but I don't believe that the authentication node is one of them. So you'll have to write custom code to read that XML file, probably even a custom membership provider.
Re: Read xml to web.config for authentication
Also if you're storing any type of password, please hash it so no one can just open it up and get a user's password.