Class providing database storage for OpenID authentication.
This class requires that the database used contains two special tables. See the tutorial for information on how to create those tables.
Example of use:
Source for this file: /AuthenticationDatabaseTiein/src/filters/openid/openid_db_store.php
ezcAuthenticationOpenidStore | --ezcAuthenticationOpenidDbStore
Version: | //autogentag// |
ezcDbHandler | read/write |
$instance
The database instance to use for database storage. |
From ezcAuthenticationOpenidStore | |
---|---|
protected |
ezcAuthenticationOpenidStore::$options
|
public ezcAuthenticationOpenidDbStore |
__construct(
$instance
, [ $options
= null] )
Creates a new object of this class. |
public ezcAuthenticationOpenidAssociation |
getAssociation(
$url
)
Returns the unserialized association linked to the OpenID provider URL. |
public bool |
removeAssociation(
$url
)
Removes the association linked to the OpenID provider URL. |
protected void |
removeNonce(
$nonce
)
Removes the nonce from the nonces table. |
public bool |
storeAssociation(
$url
, $association
)
Stores an association in the store linked to the OpenID provider URL. |
public bool |
storeNonce(
$nonce
)
Stores the nonce in the store. |
public bool|int |
useNonce(
$nonce
)
Checks if the nonce exists and afterwards deletes it. |
From ezcAuthenticationOpenidStore | |
---|---|
public abstract ezcAuthenticationOpenidAssociation |
ezcAuthenticationOpenidStore::getAssociation()
Returns the association linked to the OpenID provider URL. |
public ezcAuthenticationOpenidStoreOptions |
ezcAuthenticationOpenidStore::getOptions()
Returns the options of this class. |
public abstract bool |
ezcAuthenticationOpenidStore::removeAssociation()
Removes the association linked to the OpenID provider URL. |
public void |
ezcAuthenticationOpenidStore::setOptions()
Sets the options of this class to $options. |
public abstract bool |
ezcAuthenticationOpenidStore::storeAssociation()
Stores an association in the store linked to the OpenID provider URL. |
public abstract bool |
ezcAuthenticationOpenidStore::storeNonce()
Stores the nonce in the store. |
public abstract bool |
ezcAuthenticationOpenidStore::useNonce()
Checks if the nonce exists and afterwards deletes it. |
Creates a new object of this class.
Name | Type | Description |
---|---|---|
$instance |
ezcDbHandler | The database instance used for this store |
$options |
ezcAuthenticationOpenidDbStoreOptions | Options for this class |
Returns the unserialized association linked to the OpenID provider URL.
Returns false if the association could not be retrieved or if it expired.
Name | Type | Description |
---|---|---|
$url |
string | The URL of the OpenID provider |
Method | Description |
---|---|
ezcAuthenticationOpenidStore::getAssociation() |
Returns the association linked to the OpenID provider URL. |
Removes the association linked to the OpenID provider URL.
Returns true always.
Name | Type | Description |
---|---|---|
$url |
string | The URL of the OpenID provider |
Method | Description |
---|---|
ezcAuthenticationOpenidStore::removeAssociation() |
Removes the association linked to the OpenID provider URL. |
Removes the nonce from the nonces table.
Name | Type | Description |
---|---|---|
$nonce |
string |
Stores an association in the store linked to the OpenID provider URL.
Returns true always.
Name | Type | Description |
---|---|---|
$url |
string | The URL of the OpenID provider |
$association |
ezcAuthenticationOpenidAssociation | The association value to store |
Method | Description |
---|---|
ezcAuthenticationOpenidStore::storeAssociation() |
Stores an association in the store linked to the OpenID provider URL. |
Stores the nonce in the store.
Returns true if the nonce was stored successfully, and false otherwise.
Name | Type | Description |
---|---|---|
$nonce |
string | The nonce value to store |
Type | Description |
---|---|
ezcBaseFilePermissionException |
if the nonce cannot be written in the store |
Method | Description |
---|---|
ezcAuthenticationOpenidStore::storeNonce() |
Stores the nonce in the store. |
Checks if the nonce exists and afterwards deletes it.
Returns the timestamp of the nonce if it exists, and false otherwise.
Name | Type | Description |
---|---|---|
$nonce |
string | The nonce value to check and delete |
Method | Description |
---|---|
ezcAuthenticationOpenidStore::useNonce() |
Checks if the nonce exists and afterwards deletes it. |