あなたは私がその答えを確信していないので、皆さんに質問したいと思います。httpと制限されたセクション
私はWebサイト、Asp.Net 2.0を持っています。ここでは、認証されたユーザーだけがアクセスできるセクションがあります。成功した認証(ログイン/パス)後にのみ、ユーザーが制限セクションにリダイレクトされることを確認します。しかし、httpでhttpを使用する必要がある場合、私の質問は事実をより懸念しています。私はUserが認証され、適切な役割を果たしているPage_loadメソッドをチェックします。このように:
<identity impersonate="false" />
<authentication mode="Windows" />
<authorization>
<allow users="*" />
</authorization>
と私の認証プロセスのスナップショットがあります:
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());
}
}
だけ良くDESCのため、私のweb.configの設定のスナップショットがあり
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;
}
そうですそれは本当にhttpsを使用する必要がありますか?
ありがとうございます。 X.