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