8 * This source file is subject to the new BSD license that is bundled
9 * with this package in the file LICENSE.txt.
10 * It is also available through the world-wide-web at this URL:
11 * http://framework.zend.com/license/new-bsd
12 * If you did not receive a copy of the license and are unable to
13 * obtain it through the world-wide-web, please send an email
14 * to license@zend.com so we can send you a copy immediately.
17 * @package Zend_OpenId
18 * @subpackage Zend_OpenId_Provider
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * Abstract class to implement external storage for OpenID consumer
28 * @package Zend_OpenId
29 * @subpackage Zend_OpenId_Provider
30 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
31 * @license http://framework.zend.com/license/new-bsd New BSD License
33 abstract class Zend_OpenId_Provider_Storage
37 * Stores information about session identified by $handle
39 * @param string $handle assiciation handle
40 * @param string $macFunc HMAC function (sha1 or sha256)
41 * @param string $secret shared secret
42 * @param string $expires expiration UNIX time
45 abstract public function addAssociation($handle, $macFunc, $secret, $expires);
48 * Gets information about association identified by $handle
49 * Returns true if given association found and not expired and false
52 * @param string $handle assiciation handle
53 * @param string &$macFunc HMAC function (sha1 or sha256)
54 * @param string &$secret shared secret
55 * @param string &$expires expiration UNIX time
58 abstract public function getAssociation($handle, &$macFunc, &$secret, &$expires);
61 * Register new user with given $id and $password
62 * Returns true in case of success and false if user with given $id already
65 * @param string $id user identity URL
66 * @param string $password encoded user password
69 abstract public function addUser($id, $password);
72 * Returns true if user with given $id exists and false otherwise
74 * @param string $id user identity URL
77 abstract public function hasUser($id);
80 * Verify if user with given $id exists and has specified $password
82 * @param string $id user identity URL
83 * @param string $password user password
86 abstract public function checkUser($id, $password);
89 * Returns array of all trusted/untrusted sites for given user identified
92 * @param string $id user identity URL
95 abstract public function getTrustedSites($id);
98 * Stores information about trusted/untrusted site for given user
100 * @param string $id user identity URL
101 * @param string $site site URL
102 * @param mixed $trusted trust data from extensions or just a boolean value
105 abstract public function addSite($id, $site, $trusted);