1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (http://nette.org)
5: *
6: * Copyright (c) 2004, 2011 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: * @package Nette\Security
11: */
12:
13:
14:
15: /**
16: * Performs authentication.
17: *
18: * @author David Grudl
19: */
20: interface IAuthenticator
21: {
22: /** Credential key */
23: const USERNAME = 0,
24: PASSWORD = 1;
25:
26: /** Exception error code */
27: const IDENTITY_NOT_FOUND = 1,
28: INVALID_CREDENTIAL = 2,
29: FAILURE = 3,
30: NOT_APPROVED = 4;
31:
32: /**
33: * Performs an authentication against e.g. database.
34: * and returns IIdentity on success or throws AuthenticationException
35: * @param array
36: * @return IIdentity
37: * @throws AuthenticationException
38: */
39: function authenticate(array $credentials);
40:
41: }
42: