問題
最近在 Client 測試 IIS 的 Windows 驗證,
於是在 Default.aspx
只將 Windows 驗證
啟用,

並在 C:\Windows\System32\drivers\etc\hosts
加入127.0.0.1 rm.gss.com.tw
的設定。
default.aspx
的內容如下,
1 | protected void Page_Load(object sender, EventArgs e) |
用 localhost
, 127.0.0.1
及 rm.gss.com.tw
為 Host 來測試。
使用 localhost
連到 http://localhost/web1/default.aspx
會直接顯示這台電腦的登入者,如下,

使用 127.0.0.1
連到 http://127.0.0.1/web1/default.aspx
會要使用者輸入這台電腦(本機)的登入者及密碼來登入,如下,

使用 rm.gss.com.tw
連到 http://rm.gss.com.tw/web1/default.aspx
會要使用者輸入這台電腦(本機)的登入者及密碼來登入,
但卻一直沒有辦法通過驗證,

解法
參考 Unable to get windows authentication to work through local IIS 這篇解法,
要設定 DisableStrictNameChecking
及 BackConnectionHostNames
2 個機碼。
依筆者的測試,只需將 rm.gss.com.tw
加入到 BackConnectionHostNames
中就可以了哦~

- 註: 感謝同事 Garry 江 的分享
參考資源
Unable to get windows authentication to work through local IIS