asp.net authentication
C# Generate Password Hash with Salt
There are many options to store passwords in a database for authenticating users. One of the more secure methods is to store a one-way "hash" of the password instead of the password itself. Another option is to encrypt the password and store it in its encrypted form in the database. There are benefits and drawbacks to both approaches.
Password Hashing Benefits
- If an attacker gains access to your database, they cannot retrieve the passwords of your users because they are one-way hashed (meaning that you can't back the hash back out to its original string form)
ASP.NET Forms Authentication Simplified
There are so many tutorials online about Forms Authentication or other auth methods in ASP.NET that it is sometimes hard to wade through and get what you need. I've made a very simple wrapper class that you can include in your ASP.NET project to give you out of the box, basic forms authentication.
Get Authentication Mode from Web.Config file
If you want to find out programmatically what authentication mode the current ASP.NET website is running under you can actually read it from the web.config file using the code below.
System.Web.Configuration.AuthenticationSection section =
(System.Web.Configuration.AuthenticationSection)System.Web.Configuration.WebConfigurationManager.GetSection("system.web/authentication");Popular Articles
Last viewed:
- Fix for Firefox click() event issue
- Data Access Layer using SqlDataReader and C# - Code Explanation
- SQL Script to Create and Update a Database
- C# Download File with Progress Bar
- Tutorial for Configuring Silverlight 4, Entity Framework and WCF RIA Services in Separate Component Assemblies (DLL’s)
- Connecting to SQL Server, Oracle, and MySQL with Database or Windows Authentication

Recent comments
14 hours 1 min ago
1 day 13 hours ago
3 days 14 hours ago
4 days 4 hours ago
4 days 15 hours ago
4 days 20 hours ago
5 days 44 min ago
1 week 21 hours ago
1 week 1 day ago
1 week 4 days ago