org.openid4java.consumer
public class JdbcNonceVerifier extends org.springframework.jdbc.core.support.JdbcDaoSupport implements NonceVerifier
The JdbcNonceVerifier requires a a javax.sql.DataSource to be configured and passed in to it with the setDataSource setter method. The table name also needs to be specified, either through the constructor, or through the setTableName setter.
Since the nonces are constructed on the web server and not on the shared database server, they may accidentally collide. Also, if the machines clocks are out of sync, the nonces from the machine that is behind may be removed prematurely from the database by the other machine.
The specified table must have the following structure:
Modifier and Type | Class and Description |
---|---|
private class |
JdbcNonceVerifier.GenericNonceVerifier |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
_deleteSQL |
private java.lang.String |
_insertSQL |
private static org.apache.commons.logging.Log |
_log |
private java.lang.String |
_tableName |
private NonceVerifier |
_verifier |
INVALID_TIMESTAMP, OK, SEEN, TOO_OLD
Constructor and Description |
---|
JdbcNonceVerifier(int maxAge) |
JdbcNonceVerifier(int maxAge,
java.lang.String tableName) |
Modifier and Type | Method and Description |
---|---|
int |
getMaxAge()
Returns the expiration timeout for nonces, in seconds.
|
java.lang.String |
getTableName() |
int |
seen(java.lang.String opUrl,
java.lang.String nonce)
Checks if a nonce was seen before.
|
void |
setMaxAge(int ageSeconds)
Sets the expiration timeout for nonces, in seconds.
|
void |
setTableName(java.lang.String tableName) |
private static org.apache.commons.logging.Log _log
private NonceVerifier _verifier
private java.lang.String _tableName
private java.lang.String _deleteSQL
private java.lang.String _insertSQL
public JdbcNonceVerifier(int maxAge)
public JdbcNonceVerifier(int maxAge, java.lang.String tableName)
public int getMaxAge()
NonceVerifier
getMaxAge
in interface NonceVerifier
public void setMaxAge(int ageSeconds)
NonceVerifier
setMaxAge
in interface NonceVerifier
public int seen(java.lang.String opUrl, java.lang.String nonce)
NonceVerifier
seen
in interface NonceVerifier
NonceVerifier.OK
only if this nonce has a valid time stamp, the time stamp did not age and the nonce was not
seen before.public java.lang.String getTableName()
public void setTableName(java.lang.String tableName)
Copyright 2006-2008 Sxip Identity Corporation