I need to keep access settings to different web pages inside of my asp.net application. These setting are logins and passwords for those pages. Is it safe enough to keep them in web.config in section??
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you COULD keep log in information and passwords in your web.config and you can protect those sections by encrypting them. I don’t know if that’s the most suitable place to do so, but given your description I’ll assume that it is the best solution for your case.
Here is a robust way to implement encryption: What is the proper method for encrypting ASP.NET connetionStrings?
So to protect the settings you just call the ProtectSection method with the section you wish to protect and the protection provider of your choice (usually
DataProtectionConfigurationProviderorRSAProtectedConfigurationProvider):To un-protect a section you call the UnProtectSection method with the section you want to unprotect: