Typically, this simply causes domain-b users to crash automatically (prohibiting special AD configurations, such as forests and trusted domains. Even then, luck is to get it working.)
It will only authenticate in the domain in which the authenticating web server is located.
In case both ARE domains are authorized, just check the username, which will include the domain.
public class Global : System.Web.HttpApplication { void WindowsAuthentication_OnAuthenticate(object sender, WindowsAuthenticationEventArgs e) {
}
source share