Source for file IAuthenticator.php

Documentation is available at IAuthenticator.php

  1. 1: <?php
  2. 2:  
  3. 3: /**
  4. 4:  * Nette Framework
  5. 5:  *
  6. 6:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  7. 7:  * @license    http://nettephp.com/license  Nette license
  8. 8:  * @link       http://nettephp.com
  9. 9:  * @category   Nette
  10. 10:  * @package    Nette\Security
  11. 11:  */
  12. 12:  
  13. 13:  
  14. 14:  
  15. 15: /**
  16. 16:  * Performs authentication.
  17. 17:  *
  18. 18:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  19. 19:  * @package    Nette\Security
  20. 20:  */
  21. 21: interface IAuthenticator
  22. 22: {
  23. 23:     /**#@+ Credential key */
  24. 24:     const USERNAME 'username';
  25. 25:     const PASSWORD 'password';
  26. 26:     /**#@-*/
  27. 27:  
  28. 28:     /**#@+ Exception error code */
  29. 29:     const IDENTITY_NOT_FOUND 1;
  30. 30:     const INVALID_CREDENTIAL 2;
  31. 31:     const FAILURE 3;
  32. 32:     const NOT_APPROVED 4;
  33. 33:     /**#@-*/
  34. 34:  
  35. 35:     /**
  36. 36:      * Performs an authentication against e.g. database.
  37. 37:      * and returns IIdentity on success or throws AuthenticationException
  38. 38:      *
  39. 39:      * @param  array 
  40. 40:      * @return IIdentity 
  41. 41:      * @throws AuthenticationException
  42. 42:      */
  43. 43:     function authenticate(array $credentials);
  44. 44:  
  45. 45: }