I'm pretty new to asp.net and mvc so am trying to learn as much as I can... to do this I'm writing a blog site from scratch but I've got a bit stuck with authentication and authorization.
As I'm leaning I don't really want to use any scaffolding stuff and I'm going database first so don't want asp.net identity creating tables for me.
I'm cool with hashing and salting passwords and checking the user against the database, the bit I'm having trouble with is setting the user as logged in and checking what they should be able to access. I really would like to use the authorize attribute but if it's better not to that's fine, I'm open to all advice. Could you guys explain (or suggest a tutorial for) the following;
- set the user logged in (maybe formsauthentication.setauthcookie is this still good??)
- add the roles for the user to that cookie (or something along those lines)
- Don't leave my app horrific insecure.
- let me use [Authorize(roles="dudes, otherdudes")]
Simple?
So far all of my research seems to have sent me along lines of using asp.net identity or stuff to do with owin and talking to external authentication providers which I don't want to do.
I'm trying to learn and understand what is going on, not too deep, just more "this bit sets the cookie(sessions??)", "that bit adds the roles" etc
If I'm completely off target here some gentle directions would be appreciated.
Many thanks for your help.
Best regards, Jon