Ich möchte Sie bitten, weil ich bin mir nicht sicher über die Antwort.http und eingeschränkter Bereich
Ich habe Website, Asp.Net 2.0, wo ich Abschnitt haben, wo nur authentifizierte Benutzer Zugriff hat. Sicher wird der Benutzer erst nach erfolgreicher Authentifizierung (Login/Pass) zum eingeschränkten Bereich weitergeleitet. Aber meine Frage ist mehr um die Tatsache besorgt, wenn ich https über HTTP verwenden muss. Ich überprüfe die Methode "Seite laden", dass der Benutzer authentifiziert ist und die entsprechende Rolle hat. Wie folgt aus:
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 besser ab, gibt es Momentaufnahme meiner web.config Einstellung:
<identity impersonate="false" />
<authentication mode="Windows" />
<authorization>
<allow users="*" />
</authorization>
und es gibt Snapshot meiner Auth Prozess: So
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;
}
ist ist es wirklich notwendig https zu benutzen?
Danke für jeden Vorschlag. X.