Grails and Spring Security example of two-step authentication
For a detailed explanation of how the code works, please see the following blow posts:
grails run-app
Browse to http://localhost:8080/. You can log in using user1\password1. The 2nd step message is hard coded to 1234 currently. After that you will be redirected to a page saying "Successfully Logged in!"