I'm really new to asp.net and mvc, so I'm a bit lost.
I'm managed to log in with OpenID in my application using this Tutorial.
But I'm not sure if just setting Session["Admin"] = true is the right path to follow, so far my code is something like this:
switch (openid.Response.Status)
{
case AuthenticationStatus.Authenticated:
if (openid.Response.ClaimedIdentifier.ToString() == Settings.Default.AdminClaimedIdentifier)
Session["Admin"] = true;
FormsAuthentication.RedirectFromLoginPage(openid.Response.ClaimedIdentifier, false);
break;
...
}
The application I'm trying to write only needs one Administrator right now, and I found it to be very easy to just have this admin's OpenID in the Settings.
Basically what I want to do is have one Admin's OpenID in the Settings and them protected a whole folder based on this authentication, so every action inside it and it's subfolders needs Admin rights, something like: ~/Admin/whatever/edit/1 needs authentication.
Which would be the simplest and cleanest possible way to do this kind of authentication?