Hello, I want to implement multi factor authentication in my web application using spring security, so I need to make the authentication process on 2 steps. First one is to check username and password and the second one to check the OTP, so the authentication will be implemented using two pages. How can I achieve this ?

Thanks,

Comment From: jzheaux

Hi, @mazenaissa, this is indeed something that would be a great addition to Spring Security, but it hasn't been added yet.

There is more discussion on this at https://github.com/spring-projects/spring-security/issues/2603, so I'll close this as a duplicate, but I'd encourage you to contribute your thoughts over there.

Comment From: mazenaissa

Hello @jzheaux Is there any way to use filters to process the authentication on 2 steps ? Thanks,

Comment From: jzheaux

@mazenaissa, not one that Spring Security supports.

I've created https://github.com/spring-projects/spring-security-samples/issues/7 to add a sample, which will hopefully help in the meantime.