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: * @package Nette\Security
7: */
8:
9:
10:
11: /**
12: * Performs authentication.
13: *
14: * @author David Grudl
15: * @package Nette\Security
16: */
17: interface IAuthenticator
18: {
19: /** Credential key */
20: const USERNAME = 0,
21: PASSWORD = 1;
22:
23: /** Exception error code */
24: const IDENTITY_NOT_FOUND = 1,
25: INVALID_CREDENTIAL = 2,
26: FAILURE = 3,
27: NOT_APPROVED = 4;
28:
29: /**
30: * Performs an authentication against e.g. database.
31: * and returns IIdentity on success or throws AuthenticationException
32: * @return IIdentity
33: * @throws AuthenticationException
34: */
35: function authenticate(array $credentials);
36:
37: }
38: