Auth_OpenID_FileStore
This is a filesystem-based store for OpenID associations and
nonces. This store should be safe for use in concurrent systems on both windows and unix (excluding NFS filesystems). There are a couple race conditions in the system, but those failure cases have been set up in such a way that the worst-case behavior is someone having to try to log in a second time.
Most of the methods of this class are implementation details. People wishing to just use this store need only pay attention to the constructor.
Located in /openid/Auth/OpenID/FileStore.php (line 39)
Auth_OpenID_OpenIDStore Auth_OpenID_FileStore
Initializes a new Auth_OpenID_FileStore. This initializes the nonce and association directories, which are subdirectories of the directory passed in.
- string $directory: This is the directory to put the store directories in.
Remove expired entries from the database. This is potentially expensive, so only run when it is acceptable to take time.
Generate a new random auth key and safely store it in the location specified by $this->auth_key_name.
Retrieve an association. If no handle is specified, return the association with the most recent issue time.
- $server_url
- $handle
- Auth_OpenID_OpenIDStore::getAssociation()
- 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.
Create a unique filename for a given server url and
handle. This implementation does not assume anything about the format of the handle. The filename that is returned will contain the domain name from the server URL for ease of human inspection of the data directory.
- $server_url
- $handle
Retrieve the auth key from the file specified by $this->auth_key_name, creating it if it does not exist.
- Auth_OpenID_OpenIDStore::getAuthKey()
- 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.
Read the auth key from the auth key file. Will return None if there is currently no key.
Remove an association if it exists. Do nothing if it does not.
- $server_url
- $handle
- Auth_OpenID_OpenIDStore::removeAssociation()
- This method removes the matching association if it's found, and returns whether the association was removed or not.
Store an association in the association directory.
- $server_url
- $association
- Auth_OpenID_OpenIDStore::storeAssociation()
- This method puts an Association object into storage, retrievable by server URL and handle.
Mark this nonce as present.
- $nonce
- Auth_OpenID_OpenIDStore::storeNonce()
- Stores a nonce. This is used by the consumer to prevent replay attacks.
Return whether this nonce is present. As a side effect, mark it as no longer present.
- $nonce
- Auth_OpenID_OpenIDStore::useNonce()
- 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.
Inherited Methods
Inherited From Auth_OpenID_OpenIDStore
Auth_OpenID_OpenIDStore::getAssociation()
Auth_OpenID_OpenIDStore::getAuthKey()
Auth_OpenID_OpenIDStore::isDumb()
Auth_OpenID_OpenIDStore::removeAssociation()
Auth_OpenID_OpenIDStore::reset()
Auth_OpenID_OpenIDStore::storeAssociation()
Auth_OpenID_OpenIDStore::storeNonce()
Auth_OpenID_OpenIDStore::useNonce()
Documentation generated on Mon, 05 Mar 2007 20:59:19 +0000 by phpDocumentor 1.3.1