Auth_OpenID_DumbStore
extends Auth_OpenID_OpenIDStore
in package
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.
Most of the methods of this class are implementation details. Users of this class need to worry only about the constructor.
Table of Contents
- $auth_key : mixed
- __construct() : mixed
- Creates a new {@link Auth_OpenID_DumbStore} instance. For the security of the tokens generated by the library, this class attempts to at least have a secure implementation of getAuthKey.
- cleanup() : array<string|int, mixed>
- Shortcut for cleanupNonces(), cleanupAssociations().
- cleanupAssociations() : int
- Remove expired associations from the store.
- cleanupNonces() : int
- Remove expired nonces from the store.
- getAssociation() : Auth_OpenID_Association|null
- This implementation always returns null.
- getAuthKey() : mixed
- This method returns the auth key generated by the constructor.
- removeAssociation() : bool|mixed
- This implementation always returns false.
- reset() : mixed
- Removes all entries from the store; implementation is optional.
- storeAssociation() : mixed
- This implementation does nothing.
- supportsCleanup() : mixed
- Report whether this storage supports cleanup
- useNonce() : bool
- In a system truly limited to dumb mode, nonces must all be accepted. This therefore always returns true, which makes replay attacks feasible.
Properties
$auth_key
protected
mixed
$auth_key
Methods
__construct()
Creates a new {@link Auth_OpenID_DumbStore} instance. For the security of the tokens generated by the library, this class attempts to at least have a secure implementation of getAuthKey.
public
__construct(string $secret_phrase) : mixed
When you create an instance of this class, pass in a secret phrase. The phrase is hashed with sha1 to make it the correct length and form for an auth key. That allows you to use a long string as the secret phrase, which means you can make it very difficult to guess.
Each instance that is created for use by your consumer site needs to use the same $secret_phrase.
Parameters
- $secret_phrase : string
-
The phrase used to create the auth key returned by getAuthKey
Return values
mixed —cleanup()
Shortcut for cleanupNonces(), cleanupAssociations().
public
cleanup() : array<string|int, mixed>
This method is not called in the normal operation of the library. It provides a way for store admins to keep their storage from filling up with expired data.
Return values
array<string|int, mixed> —cleanupAssociations()
Remove expired associations from the store.
public
cleanupAssociations() : int
This method is not called in the normal operation of the library. It provides a way for store admins to keep their storage from filling up with expired data.
Return values
int —the number of associations expired.
cleanupNonces()
Remove expired nonces from the store.
public
cleanupNonces() : int
Discards any nonce from storage that is old enough that its timestamp would not pass useNonce().
This method is not called in the normal operation of the library. It provides a way for store admins to keep their storage from filling up with expired data.
Return values
int —the number of nonces expired
getAssociation()
This implementation always returns null.
public
getAssociation(string $server_url[, null $handle = null ]) : Auth_OpenID_Association|null
Parameters
- $server_url : string
- $handle : null = null
Return values
Auth_OpenID_Association|null —getAuthKey()
This method returns the auth key generated by the constructor.
public
getAuthKey() : mixed
Return values
mixed —removeAssociation()
This implementation always returns false.
public
removeAssociation(string $server_url, string $handle) : bool|mixed
Parameters
- $server_url : string
- $handle : string
Return values
bool|mixed —reset()
Removes all entries from the store; implementation is optional.
public
reset() : mixed
Return values
mixed —storeAssociation()
This implementation does nothing.
public
storeAssociation(string $server_url, Auth_OpenID_Association $association) : mixed
Parameters
- $server_url : string
- $association : Auth_OpenID_Association
Return values
mixed —supportsCleanup()
Report whether this storage supports cleanup
public
supportsCleanup() : mixed
Return values
mixed —useNonce()
In a system truly limited to dumb mode, nonces must all be accepted. This therefore always returns true, which makes replay attacks feasible.
public
useNonce(string $server_url, int $timestamp, string $salt) : bool
Parameters
- $server_url : string
- $timestamp : int
- $salt : string