The first part is done using the MVC Authorize tag on the method
Now I need a way to also let user on our AD domain access. So the first thing I have done is created a custom authorization.. The code below shows what I am trying to do.. How do I do it? Or is it a simple addition to my config perhaps?
public class AuthorizeUserAttribute : AuthorizeAttribute
{
public string AccessLevel { get; set; }
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
var isAuthorized = base.AuthorizeCore(httpContext);
//act as normal
if (isAuthorized)
{
return true;
}
//check in AD member
else
{
//Some code to check if the user who put the URL in the browser is a AD user on our domain????
//return true
//else
return false;
}
}
}