Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Authentication behind AWS Elastic Load Balancer (ELB) not working

I have an ASP .NET MVC 5 site that uses Windows Authentication. The main page just displays the current Identity name (Controller.User.Identity.Name) for testing purposes. After deploying the website to the server (Windows Server 2012) and enabling Windows Authentication on IIS I visit the page going directly to the server. It prompts for credentials, I provide my AD username/password once and it works. So far so good.

Now, if I have the same server behind an AWS Elastic Load Balancer (only that one server) and I hit the site on the load balancer I noticed two issues:

  • The page prompts many times for credentials. After clicking OK several times it works.
  • I had a colleague login on his machine (he had to click several times too), then I went back to my computer. When I visited the url it didn't prompt. It worked right away and it said the current user was my colleague.

This is very strange. Almost like the Kerberos ticket is getting lost or confused because of the load balancer. I tried this and step 4 from here, still no luck.

Any ideas?

like image 282
oscarmorasu Avatar asked Apr 08 '14 16:04

oscarmorasu


People also ask

What happens to instances that are not functioning properly in an ELB?

If one EC2 instance fails, Elastic Load Balancing automatically reroutes the traffic to the remaining running EC2 instances. If the failed EC2 instance is restored, Elastic Load Balancing restores the traffic to that instance.

Why is ELB health check failing?

An instance might fail the ELB health check because an application running on the instance has issues that cause the load balancer to consider the instance out of service.

How do I know if my ELB is working?

Under the load balancer configuration page, you can see how many instances are running. ELB does not use Elastic IP addresses. You'll need to perform your test using more than one client computer. ELB will keep sending requests to the same EC2 instance that originate from the same remote IP.

Why load balancer is not working?

If the load balancer is not responding to requests, check for the following issues: Your internet-facing load balancer is attached to a private subnet. You must specify public subnets for your load balancer. A public subnet has a route to the Internet Gateway for your virtual private cloud (VPC).


Video Answer


1 Answers

According to this blog post, ELB will work if you switch it to TCP mode:

https://cloudninjablog.wordpress.com/2014/08/22/configuring-aws-elb-to-work-with-windows-authentication/

like image 146
Jason Avatar answered Oct 29 '22 15:10

Jason