I have a Windows Authentication Intranet site.
<authentication mode="Windows" >
</authentication>
<authorization>
<deny users="?" />
</authorization>
If the user fails the authorization on the Controller,
[Authorize(Roles="Admin")]
public class SearchController : BaseController
I want them directed to ~/UnAuthorized/Index
Can this be set in the Web.Config, similar to Forms authentication where I can redirect to a login page? I just want the redirect to a simple [AllowAnonymous] Controller I have at (~/UnAuthorized/Index)
No, this cannot be easily set. If a user is not authenticated for a given application the user agent is prompting him to provide his credentials. You don’t have much control over the UI aspect of this dialog with Windows Authentication.