two_step_validation.rst 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Two Step Validation (with Google Authenticator)
  2. ===============================================
  3. The SonataUserBundle provides an optional layer of security by including a support for a Two Step Validation process.
  4. When the option is enabled, the login process is done with the following workflow :
  5. * the user enters the login and password
  6. * if the user get the correct credentials, then
  7. * a code validation form is diplayed
  8. * at this point the user must enter a time based code provided by the Google Authenticator application
  9. * the code is valid only once per minute
  10. So if your login and password are compromised then the hacker must also hold your phone!
  11. Installation
  12. ------------
  13. Add the following lines to the file ``deps``::
  14. [GoogleAuthenticator]
  15. git=git://github.com/rande/GoogleAuthenticator.php.git
  16. target=/google-authenticator
  17. Update the autoload.php file::
  18. // app/autoload.php
  19. $loader->registerNamespaces(array(
  20. // ...
  21. 'Google' => __DIR__.'/../vendor/google-authenticator/lib'
  22. // ...
  23. ));
  24. Edit the configuration file
  25. .. code-block:: yaml
  26. # app/config/config.yml
  27. sonata_user:
  28. google_authenticator:
  29. enabled: true
  30. server: yourserver.com
  31. Now if the ``User::twoStepVerificationCode`` property is not null, then a second form will be displayed.