It's certainly possible, we use Spring Security and Webflow for just this purpose in our platform. Our implementation goes something like this:
- User is prompted to enter his username (Page 1)
- We display his/her "Siteseal" (basically a form of mutual authentication to prevent phishing) (Page 2)
- We prompt the user to enter his password and two factor token password (Page 2)
We use Webflow to handle the login flow and map the spring security login-page to this:
Code:
<security:form-login login-page="/login" />
We then programatically authenticate the user within the flow:
Code:
SecurityContextHolder.getContext().setAuthentication(auth);