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