PageRenderTime 42ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/Nette/Security/IAuthenticator.php

https://github.com/DocX/nette
PHP | 55 lines | 11 code | 8 blank | 36 comment | 0 complexity | 97d5bdd51a8617e065c12b1aafdd031b MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /**
  3. * Nette Framework
  4. *
  5. * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
  6. *
  7. * This source file is subject to the "Nette license" that is bundled
  8. * with this package in the file license.txt.
  9. *
  10. * For more information please see http://nettephp.com
  11. *
  12. * @copyright Copyright (c) 2004, 2009 David Grudl
  13. * @license http://nettephp.com/license Nette license
  14. * @link http://nettephp.com
  15. * @category Nette
  16. * @package Nette\Security
  17. */
  18. /*namespace Nette\Security;*/
  19. /**
  20. * Performs authentication.
  21. *
  22. * @author David Grudl
  23. * @copyright Copyright (c) 2004, 2009 David Grudl
  24. * @package Nette\Security
  25. */
  26. interface IAuthenticator
  27. {
  28. /**#@+ Credential key */
  29. const USERNAME = 'username';
  30. const PASSWORD = 'password';
  31. /**#@-*/
  32. /**#@+ Exception error code */
  33. const IDENTITY_NOT_FOUND = 1;
  34. const INVALID_CREDENTIAL = 2;
  35. const FAILURE = 3;
  36. const NOT_APPROVED = 4;
  37. /**#@-*/
  38. /**
  39. * Performs an authentication against e.g. database.
  40. * and returns IIdentity on success or throws AuthenticationException
  41. *
  42. * @param array
  43. * @return IIdentity
  44. * @throws AuthenticationException
  45. */
  46. function authenticate(array $credentials);
  47. }