two_step_validation.rst 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. .. index::
  2. single: Two-step validation
  3. single: Authentication
  4. single: Google
  5. Two-step Validation (with Google Authenticator)
  6. ===============================================
  7. The ``SonataUserBundle`` provides an optional layer of security by including a support for a Two-step Validation process.
  8. When the option is enabled, the login process is done with the following workflow:
  9. * the user enters the login and password
  10. * if the user get the correct credentials, then a code validation form is displayed
  11. * at this point, the user must enter a time based code provided by the Google 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 your phone!
  14. Installation
  15. ------------
  16. Add the following line to the ``composer.json`` file::
  17. "sonata-project/google-authenticator": "dev-master"
  18. Edit the configuration file:
  19. .. code-block:: yaml
  20. # app/config/config.yml
  21. sonata_user:
  22. google_authenticator:
  23. enabled: true
  24. server: yourserver.com
  25. Now if the ``User::twoStepVerificationCode`` property is not null, then a second form will be displayed.