O'Reilly logo

Spring Security 3.x Cookbook by Anjana Mankale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spring Security with multiple input authentications

In this section, we will demonstrate multiple input authentications. This is also called two factor authentications. So far, in all our examples, we are authenticating against username and password. In this example, we will provide another field for phone number along with username. It is the same horrormovie application with hibernate and derby database.

Getting ready

  • Create a custom filter to handle the new login form
  • Configure the custom filter in your Springsecurity.xml file
  • Update the UserDetailsService implementation class to handle the additional input
  • Add an extra column named MOBILE_NO in your database
  • Update the login.jsp file to take MOBILE_NO as input

How to do it...

The following are the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required