/Nette/Security/IAuthenticator.php
PHP | 55 lines | 11 code | 8 blank | 36 comment | 0 complexity | 97d5bdd51a8617e065c12b1aafdd031b MD5 | raw file
Possible License(s): BSD-3-Clause
- <?php
- /**
- * Nette Framework
- *
- * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- *
- * This source file is subject to the "Nette license" that is bundled
- * with this package in the file license.txt.
- *
- * For more information please see http://nettephp.com
- *
- * @copyright Copyright (c) 2004, 2009 David Grudl
- * @license http://nettephp.com/license Nette license
- * @link http://nettephp.com
- * @category Nette
- * @package Nette\Security
- */
- /*namespace Nette\Security;*/
- /**
- * Performs authentication.
- *
- * @author David Grudl
- * @copyright Copyright (c) 2004, 2009 David Grudl
- * @package Nette\Security
- */
- interface IAuthenticator
- {
- /**#@+ Credential key */
- const USERNAME = 'username';
- const PASSWORD = 'password';
- /**#@-*/
- /**#@+ Exception error code */
- const IDENTITY_NOT_FOUND = 1;
- const INVALID_CREDENTIAL = 2;
- const FAILURE = 3;
- const NOT_APPROVED = 4;
- /**#@-*/
- /**
- * Performs an authentication against e.g. database.
- * and returns IIdentity on success or throws AuthenticationException
- *
- * @param array
- * @return IIdentity
- * @throws AuthenticationException
- */
- function authenticate(array $credentials);
- }