1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (http://nette.org)
5: *
6: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
7: *
8: * For the full copyright and license information, please view
9: * the file license.txt that was distributed with this source code.
10: */
11:
12: namespace Nette\Security;
13:
14: use Nette;
15:
16:
17: /**
18: * Performs authentication.
19: *
20: * @author David Grudl
21: */
22: interface IAuthenticator
23: {
24: /** Credential key */
25: const USERNAME = 0,
26: PASSWORD = 1;
27:
28: /** Exception error code */
29: const IDENTITY_NOT_FOUND = 1,
30: INVALID_CREDENTIAL = 2,
31: FAILURE = 3,
32: NOT_APPROVED = 4;
33:
34: /**
35: * Performs an authentication against e.g. database.
36: * and returns IIdentity on success or throws AuthenticationException
37: * @return IIdentity
38: * @throws AuthenticationException
39: */
40: function authenticate(array $credentials);
41:
42: }
43: