I'm currently working on a ASP.NET MVC4 website. And in that website i wan't users that are part of an certain role to be allowed to run the code. I use the following code:
[Authorize(Roles = GROUP)]
public void Auth()
{
/* if user is in the domain and signed in
* and a member of the above group
* they will come here */
username = User.Identity.Name;
//Do somthing
}
And this works great, but when the user isn't part of the domain and/or group it wil prompt for username and password. Is it possible to skip the prompt and just redirect that user?
This website is setup in a IIS 8 with authentication set to windows authentication