0
我是MVC4環境的新手。並試圖根據角色限制對特定控制器的訪問。通過窗口認證授權訪問控制器
[Authorize(Roles = "Administrators")]
public class AdminController : Controller
{
}
它工作正常,並要求用戶憑據。但我不希望它要求憑證。相反,它應該自動檢查窗口用戶的角色。如果他是特定角色的成員,則允許他訪問網站頁面。
你能指導我該怎麼做嗎?
http://www.wiktorzychla.com/2012/06/iis-75-integrated-security-with-no.html –
參見[使用Windows身份驗證驗證用戶] (http://www.asp.net/mvc/tutorials/older-versions/security/authenticating-users-with-windows-authentication-cs)。 – James
謝謝! Wiktor的。 @Wiktor我遵循你的建議,並能隱藏要求憑據的窗口。 –