two_step_validation.rst 1.3 KB

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