It turns out that Spring Security uses ServletRequest.getServerPort () to determine if it uses a secure port. My tomcat was configured using 8080 and 8443, so when ELB forwards the request from 443 to my internal tomcat to 8443, webapp did not accept this as a secure port:
20 Jun 18:16:49,184 ["http-bio-8443"-exec-5] DEBUG org.springframework.security. web.access.channel.RetryWithHttpsEntryPoint - Redirecting to: /login.xhtml
I also tried using a proxy port, but could not get this to work. Also, if you configured Spring security ports to use 8443 instead, it will not do the redirection correctly (it will redirect the application to 8443, which does not exist externally).
A short story ... the following settings worked: ELB forward 80-> 80 and 443-> 443. Set tomcat to use 80 and 443. Map port ports to use 80 and 443 in Spring Security
source share