Java – spring security login 2fa – first check the user name and password, and then request 2fa code when needed

I have set 2fa spring safety The problem is that the 2fa code must now be entered in the same form as the user name / password Is there any way to first ask for a user name and password, and then, if they are valid, ask for the 2fa code?

Solution

I did the same thing in angularjs

When angular receives 403 status, it will hide the user name and password fields and display the OTP field At this point, the user name and password still appear as angle objects, but only hidden

When the user enters OTP and clicks submit, I call again, this time through user name, password and OTP

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>