目前,我們有以下的情況:設置SSL VS使用DLL進行認證登錄
月1日,有一個Web應用程序,並在用戶需要登錄的Web應用程序,用戶將提供他/她的賬戶用戶名和密碼。
用戶名和密碼將使用以下代碼的AD進行驗證:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.DirectoryServices;
using System.DirectoryServices.AccountManagement;
namespace Access
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, txtboxDomain.Text))
{
bool isValid = pc.ValidateCredentials(txtboxUsername.Text, txtboxPassword.Text);
if (isValid == true)
{
lblLogin.Text = "VALID";
Session["Person"] = txtboxUsername.Text;
Session.Timeout = 1;
}
else
{
lblLogin.Text = "INVALID";
}
}
}
}
}
然而,同事「A」提的是,上述方法不是安全的。
她的理由提供如下:
- 有一個在IIS沒有SSL設置。
- 即使在IIS上沒有SSL安裝程序,至少也要使用IT部門的安全DLL文件來提供身份驗證方法。
但是,另一位同事'B'懷疑她的答案,他說因爲代碼將通過Active Directory(AD)進行身份驗證,所以它肯定是安全的,因此不需要在Web應用程序託管的IIS。
此外,他告訴她,IT部門的安全DLL文件可能不提供額外的安全性,因爲它首先是封閉的,其次,他認爲它只是減少了對驗證方法進行編碼的需要。
那麼,我可否知道我的同事A在多大程度上正確或我的同事B是正確的?
SSL提供的傳輸安全性與AD查詢完全無關。 – GameScripting
但是,用戶名和密碼在局域網內以明文形式傳輸,並且可以使用網絡嗅探器輕鬆實現。 – highwingers
那麼,這是否意味着我的同事實際上是錯的? (或者也許他們是部分正確的?) – Jack