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 USERNAME = 0,
18: PASSWORD = 1;
19:
20: /** Exception error code */
21: const IDENTITY_NOT_FOUND = 1,
22: INVALID_CREDENTIAL = 2,
23: FAILURE = 3,
24: NOT_APPROVED = 4;
25:
26: /**
27: * Performs an authentication against e.g. database.
28: * and returns IIdentity on success or throws AuthenticationException
29: * @return IIdentity
30: * @throws AuthenticationException
31: */
32: function authenticate(array $credentials);
33:
34: }
35: