Two Page Login with Spring Security 3.2.x

Viewed 545

We are brand new to Java, Spring, and Spring Security, but not new to development. We've been able to create a Spring Security-based Thymeleaf login page that uses a JNDI datasource to connect to our SQL Server database using BCrypt encrypted passwords. All of that is working without a hitch. However, the client wants a two-stage login. The first page requests a company ID that then loads a login page with specific graphics and text for that company, which allows the user to know that they are not logging into a phishing site. That login page would then request the user name and password.

We have searched extensively on here and the web as a whole and have not found a solid method for doing this. We believe that we may to have to create a custom UserDetailsService and AuthenticationManager, but still can't see how to implement it so that:

  1. User cannot bypass first login screen and go straight to second screen
  2. SpringSecurity is in control of both pages

We saw one suggestion about using Spring WebFlow with Spring Security, but without some starting point, have no idea how WebFlow works or applies to this scenario. This site helped us greatly in getting to this stage, but now we are stymied. Any help you can provide is greatly appreciated.

2 Answers
Related