.NET Questions (CLOSED)

Questions and Answers on any aspect of .NET. Now closed.

This discussion group is now closed.

Have a question about .NET development? Try stackoverflow.com, a worldwide community of great developers asking and answering questions 24 hours a day.

The archives of .NET Questions contain years of Q&A. Even older .NET Questions are still online, too.

Reading password from webconfig

Because of security reason, I want to read password from a file in the server within the .NET Webconfig file. Did anyone know if this is workable? Let me know, thank you.
Fergus Lam Send private email
Monday, January 21, 2008
 
 
You can use encryption to store passwords and connection strings in web.config. This is built into ASP.NET 2.0:
http://aspnet.4guysfromrolla.com/articles/021506-1.aspx
Mark Pearce Send private email
Monday, January 21, 2008
 
 
FYI: not just for asp.net -- you can use it anywhere. I used it in a Winforms app...
jonathan Send private email
Wednesday, January 23, 2008
 
 
Also, consider giving the server application minimal priviledges, and giving end users their own database logon.

That way, you can make them log on, and then connect to the database using their credentials - thus avoiding the need to store important passwords anywhere on the server.

(Obviously not always practical, but sometimes it works.)

The hardest data to steal is the data that isn't stored on the server in the first place.

Wednesday, January 23, 2008
 
 
>> I used it in a Winforms app... <<

The built-in config encryption dos indeed work with WinForms apps as well, but you still need to use aspnet_regiis for command-line configuration of the key containers if you're using RSA encryption.
Mark Pearce Send private email
Wednesday, January 23, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz