In ASP.Net, is there ever a reason to flatly make your own authentication instead of using Forms Security(and writing a custom provider)?
What limitations exist to Forms Security and why would someone want to write their own authentication?
In ASP.Net, is there ever a reason to flatly make your own authentication instead of using Forms Security(and writing a custom provider)?
What limitations exist to Forms Security and why would someone want to write their own authentication?
One of the limitations of the out-of-the-box providers is the ProfileProvider. It stores all of the profile information for a user in a single database field, making it difficult to query directly.
Luckily there is a good Table based provider described here in Scott Guthrie's blogg: http://weblogs.asp.net/scottgu/archive/2006/01/10/435038.aspx
But generally, i would use the standard Membership provider and controls. They are well tested and they save a lot of coding.
Apart from that, the use of Guids foir all of the Ids annoys me as I prefer ints. I know, Guids are not limited to a couple of billion users, but none of my sites have had that many people register yet.
I've used ASP.NET Membership extensively and have written several website security schemes in .NET.
I don't know of any gaping security holes in .NET Membership. There are some various concerns such as storing login credentials in a database, but for most purposes you can configure the Membership options so it's relatively safe. You can add password salt, minimum/max pass length, complexity options, pass attempts, etc. In some larger companies they prefer to use ActiveDirectory or Kerberos authentication because the accounts can be controlled by domain or zone admins. .NET Membership DOES support those authentication methods.
The biggest issues I have run into using it are:
In agreement with Daniel, though, for most purposes it works fine and will save you a lot of work. It's tested, it has a truckload of options, and it works well.
Writing your own login controls has long been a recipe for disaster. In fact, I think it was flagged as an OWASP Top 10 (security) problem for a couple of years running.