Search code examples
amazon-web-servicesamazon-ec2amazon-cognitoamazon-elbaws-alb

500 error trying to authenticate via AWS Application load balancer and Cognito


I am trying to setup Authentication for some certain routes using AWS internet-facing Application load balancer.

I've done all the steps from the official AWS documentation, and also using this one: https://www.thorntech.com/2018/09/user-authentication-alb-cognito/

I was testing via load balancer's DNS name, and it redirects me properly to the login form of Cognito, but after I am logged in it redirects to the load balancer, and it gives 500 Internal Server Error. URL is like so https://xxxxx.eu-west-1.elb.amazonaws.com/oauth2/idpresponse?code=.......

Do you know, which can be the causes of it, and what should I configure else to make it working?

openid is allowed


Solution

  • To answer my own question - the problem is with the security groups. You have to have a security group with the open port 443 on your load balancer!