i'm need create authentication in one of projects, but simple login/password not suitable. Needs stepwise authentication: 1'st - user enter its phone number - check if user exists, then to phone send sms and open next form, else show message; 2'st - form with code input, user enter obtained code - check if code equals generated then authenticate user, else send again.
As sample i thought get phone data in custom controller and if user finded show him form the similarity:
<form action="{{ path('login_check') }}" method="post">
<input type="hidden" id="username" name="_username" value="{{ user_phone }}" />
<label for="password">Code:</label>
<input type="text" id="password" name="_password" value="" />
<input type="submit" name="login" />
</form>
But i do not like this option. Perhaps somebody tell more beautiful version?)