Hi, I would like to ask you guys cause I am not sure about the answer.
I have website, Asp.Net 2.0, where I have section where only authenticated user has access. For sure user is redirected to restricted section only after successful authentication (login/pass). But my question is more concerned about fact if I need to use https over http. I do check on Page_load method that user is authenticated and is in appropriate role. Like this:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ApplyAuthorizationRules();
InitData();
}
}
private void ApplyAuthorizationRules()
{
//Check if the user is logged in
if (!Page.User.Identity.IsAuthenticated)
{
Response.Redirect(NotAuthenticated.UrlToSelf());
}
//check if the user is in one of FU roles
if (!Page.User.IsInRole(Constants.ROLECLIENT))
{
Response.Redirect(NotAuthorized.UrlToSelf());
}
}
Just for better desc, there is snapshot of my web.config setting:
<identity impersonate="false" />
<authentication mode="Windows" />
<authorization>
<allow users="*" />
</authorization>
and there is snapshot of my auth process:
public static bool Login(string username, string password)
{
AppIdentity identity = AppIdentity.GetIdentity(username, password);
AppPrincipal principal = new AppPrincipal(identity);
HttpContext.Current.User = principal;
return identity.IsAuthenticated;
}
So is it really neccessary to use https?
Thanks for any suggestion. X.