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

 Class Auth_OpenID_OpenIDStore

Description

This is the interface for the store objects the OpenID library

uses. It is a single class that provides all of the persistence mechanisms that the OpenID library needs, for both servers and consumers. If you want to create an SQL-driven store, please see then Auth_OpenID_SQLStore class.

Located in /openid/Auth/OpenID/Interface.php (line 26)

Class Auth_OpenID_OpenIDStore
Direct descendents
Class Description
ClassAuth_OpenID_FileStore This is a filesystem-based store for OpenID associations and
ClassAuth_OpenID_DumbStore This is a store for use in the worst case, when you have no way of saving state on the consumer site. Using this store makes the consumer vulnerable to replay attacks, as it's unable to use nonces. Avoid using this store if it is at all possible.
ClassAuth_OpenID_SQLStore This is the parent class for the SQL stores, which contains the logic common to all of the SQL stores.
Variable Summary
Variable integer $AUTH_KEY_LEN
Method Summary
Method Association getAssociation (string $server_url, [mixed $handle = null])
Method string getAuthKey ()
Method bool isDumb ()
Method mixed removeAssociation (string $server_url, string $handle)
Method void reset ()
Method void storeAssociation (string $server_url, Association $association)
Method null storeNonce (string $nonce)
Method bool useNonce (string $nonce)
Variables
integer $AUTH_KEY_LEN = 20 (line 31)
  • var: The length of the auth key that should be returned by the getAuthKey method.
Methods
getAssociation (line 82)

This method returns an Association object from storage that matches the server URL and, if specified, handle. It returns null if no such association is found or if the matching association is expired.

If no handle is specified, the store may return any association which matches the server URL. If multiple associations are valid, the recommended return value for this method is the one that will remain valid for the longest duration.

This method is allowed (and encouraged) to garbage collect expired associations when found. This method must not return expired associations.

  • return: The Association for the given identity server.
Association getAssociation (string $server_url, [mixed $handle = null])
  • string $server_url: The URL of the identity server to get the association for. Because of the way the server portion of the library uses this interface, don't assume there are any limitations on the character set of the input string. In particular, expect to see unescaped non-url-safe characters in the server_url field.
  • mixed $handle: This optional parameter is the handle of the specific association to get. If no specific handle is provided, any valid association matching the server URL is returned.

Redefined in descendants as:
getAuthKey (line 157)

This method returns a key used to sign the tokens, to ensure that they haven't been tampered with in transit. It should return the same key every time it is called. The key returned should be AUTH_KEY_LEN bytes long.

  • return: The key. It should be AUTH_KEY_LEN bytes in length, and use the full range of byte values. That is, it should be treated as a lump of binary data stored in a string.
string getAuthKey ()

Redefined in descendants as:
isDumb (line 175)

This method must return true if the store is a dumb-mode-style store. Unlike all other methods in this class, this one provides a default implementation, which returns false.

In general, any custom subclass of Auth_OpenID_OpenIDStore won't override this method, as custom subclasses are only likely to be created when the store is fully functional.

  • return: true if the store works fully, false if the consumer will have to use dumb mode to use this store.
bool isDumb ()

Redefined in descendants as:
removeAssociation (line 106)

This method removes the matching association if it's found, and returns whether the association was removed or not.

  • return: Returns whether or not the given association existed.
mixed removeAssociation (string $server_url, string $handle)
  • string $server_url: The URL of the identity server the association to remove belongs to. Because of the way the server portion of the library uses this interface, don't assume there are any limitations on the character set of the input string. In particular, expect to see unescaped non-url-safe characters in the server_url field.
  • string $handle: This is the handle of the association to remove. If there isn't an association found that matches both the given URL and handle, then there was no matching handle found.

Redefined in descendants as:
reset (line 183)

Removes all entries from the store; implementation is optional.

void reset ()

Redefined in descendants as:
storeAssociation (line 46)

This method puts an Association object into storage, retrievable by server URL and handle.

void storeAssociation (string $server_url, Association $association)
  • string $server_url: The URL of the identity server that this association is with. Because of the way the server portion of the library uses this interface, don't assume there are any limitations on the character set of the input string. In particular, expect to see unescaped non-url-safe characters in the server_url field.
  • Association $association: The Association to store.

Redefined in descendants as:
storeNonce (line 120)

Stores a nonce. This is used by the consumer to prevent replay attacks.

null storeNonce (string $nonce)
  • string $nonce: The nonce to store.

Redefined in descendants as:
useNonce (line 141)

This method is called when the library is attempting to use a nonce. If the nonce is in the store, this method removes it and returns a value which evaluates as true. Otherwise it returns a value which evaluates as false.

This method is allowed and encouraged to treat nonces older than some period (a very conservative window would be 6 hours, for example) as no longer existing, and return False and remove them.

  • return: Whether or not the nonce was valid.
bool useNonce (string $nonce)
  • string $nonce: The nonce to use.

Redefined in descendants as:

Documentation generated on Mon, 05 Mar 2007 21:08:44 +0000 by phpDocumentor 1.3.1