Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: OpenID

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /openid/Auth/OpenID/DumbStore.php

Documentation is available at DumbStore.php

  1. <?php
  2.  
  3. /**
  4.  * This file supplies a dumb store backend for OpenID servers and
  5.  * consumers.
  6.  *
  7.  * PHP versions 4 and 5
  8.  *
  9.  * LICENSE: See the COPYING file included in this distribution.
  10.  *
  11.  * @package OpenID
  12.  * @author JanRain, Inc. <[email protected]>
  13.  * @copyright 2005 Janrain, Inc.
  14.  * @license http://www.gnu.org/copyleft/lesser.html LGPL
  15.  */
  16.  
  17. /**
  18.  * Import the interface for creating a new store class.
  19.  */
  20. require_once 'Auth/OpenID/Interface.php';
  21. require_once 'Auth/OpenID/HMACSHA1.php';
  22.  
  23. /**
  24.  * This is a store for use in the worst case, when you have no way of
  25.  * saving state on the consumer site. Using this store makes the
  26.  * consumer vulnerable to replay attacks, as it's unable to use
  27.  * nonces. Avoid using this store if it is at all possible.
  28.  *
  29.  * Most of the methods of this class are implementation details.
  30.  * Users of this class need to worry only about the constructor.
  31.  *
  32.  * @package OpenID
  33.  */
  34.  
  35.     /**
  36.      * Creates a new {@link Auth_OpenID_DumbStore} instance. For the security
  37.      * of the tokens generated by the library, this class attempts to
  38.      * at least have a secure implementation of getAuthKey.
  39.      *
  40.      * When you create an instance of this class, pass in a secret
  41.      * phrase. The phrase is hashed with sha1 to make it the correct
  42.      * length and form for an auth key. That allows you to use a long
  43.      * string as the secret phrase, which means you can make it very
  44.      * difficult to guess.
  45.      *
  46.      * Each {@link Auth_OpenID_DumbStore} instance that is created for use by
  47.      * your consumer site needs to use the same $secret_phrase.
  48.      *
  49.      * @param string secret_phrase The phrase used to create the auth
  50.      *  key returned by getAuthKey
  51.      */
  52.     function Auth_OpenID_DumbStore($secret_phrase)
  53.     {
  54.         $this->auth_key Auth_OpenID_SHA1($secret_phrase);
  55.     }
  56.  
  57.     /**
  58.      * This implementation does nothing.
  59.      */
  60.     function storeAssociation($server_url$association)
  61.     {
  62.     }
  63.  
  64.     /**
  65.      * This implementation always returns null.
  66.      */
  67.     function getAssociation($server_url$handle null)
  68.     {
  69.         return null;
  70.     }
  71.  
  72.     /**
  73.      * This implementation always returns false.
  74.      */
  75.     function removeAssociation($server_url$handle)
  76.     {
  77.         return false;
  78.     }
  79.  
  80.     /**
  81.      * This implementation does nothing.
  82.      */
  83.     function storeNonce($nonce)
  84.     {
  85.     }
  86.  
  87.     /**
  88.      * In a system truly limited to dumb mode, nonces must all be
  89.      * accepted. This therefore always returns true, which makes
  90.      * replay attacks feasible.
  91.      */
  92.     function useNonce($nonce)
  93.     {
  94.         return true;
  95.     }
  96.  
  97.     /**
  98.      * This method returns the auth key generated by the constructor.
  99.      */
  100.     function getAuthKey()
  101.     {
  102.         return $this->auth_key;
  103.     }
  104.  
  105.     /**
  106.      * This store is a dumb mode store, so this method is overridden
  107.      * to return true.
  108.      */
  109.     function isDumb()
  110.     {
  111.         return true;
  112.     }
  113. }
  114.  
  115. ?>

Documentation generated on Mon, 05 Mar 2007 20:56:52 +0000 by phpDocumentor 1.3.1