dimanche 19 avril 2015

Create a SIMPLE ASP.NET WebForms app with role-based authentication

I've been looking into the two major options for user authentication in ASP.NET and after skimming over a few articles I am absolutely baffled. The last time I dabbled in ASP.NET, the .NET framework was only at v.2.0 which used the Membership system. I can't even really remember how that worked, let alone wrap my head around all this new Entity Framework and Identity stuff.


I like the sound of being able to use external logins (Facebook, Twitter, etc.) and roles, but seriously, why is this crap so damn complicated?! I thought ASP.NET was supposed to make a developer's life easier, but just learning how to use it seems like it will take me a week! I'm already behind schedule (this is for a uni project) and my supervisor is getting PO'ed at how long I'm taking to produce no results.


I just want a simple, easy-to-learn-and-use methodology for creating the following:



  1. A custom database schema with lots of extra user columns (survey questions that they have to answer) and maybe a model to go with it, although I'd be just as happy to use raw SQL (that seems to be easier to me!).

  2. A registration page that automatically hashes the entered password (preferably with 1000 iterations of PBKDF2, a 32-byte salt and whatever hash function you would recommend for strong security) and redirects to a customised "members" view of Default.aspx on successful registration, or posts back to itself and displays errors if any (depending upon custom validation logic).

  3. A login page that also redirects to the same customised Default.aspx and has the usual "Remember Me" checkbox.

  4. An "admin" role and "user" role, with registration adding to the users role. A single admin user will be created manually, but they will sign in through the same login form, then be presented with an admin page where they can view/delete users and all their info.


I currently have 1. and 2. implemented with nothing but HTML, CSS, jQuery and SQL, then I started on the login page and realised ASP.NET could probably do a lot of this for me. But how??


Maybe I haven't looked hard enough, or I'm too tired and overworked to fully take in what I've read, but I just want a simple, concise solution that covers all of these bases in one place! Scouring Google is getting me nowhere as it seems I have to read 5 different 2,000 word articles just to understand all of this stuff!


Anyone that can help me out will become my new god!


Aucun commentaire:

Enregistrer un commentaire