|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.jdbc.authentication.AuthenticationServiceBase
public abstract class AuthenticationServiceBase
This is the authentication service base class.
There can be 1 Authentication Service for the whole Derby system and/or 1 authentication per database. In a near future, we intend to allow multiple authentication services per system and/or per database.
It should be extended by the specialized authentication services. IMPORTANT NOTE: -------------- User passwords are encrypted using SHA-1 message digest algorithm if they're stored in the database; otherwise they are not encrypted if they were defined at the system level. SHA-1 digest is single hash (one way) digest and is considered very secure (160 bits).
| Field Summary | |
|---|---|
protected UserAuthenticator |
authenticationScheme
|
static java.lang.String |
AuthenticationTrace
Trace flag to trace authentication operations |
static java.lang.String |
ID_PATTERN_NEW_SCHEME
Pattern that is prefixed to the stored password in the new authentication scheme |
static int |
MAGICLEN_NEWENCRYPT_SCHEME
Length of the encrypted password in the new authentication scheme See Beetle4601 |
protected static int |
SECMEC_USRSSBPWD
Userid with Strong password substitute DRDA security mechanism |
private AccessFactory |
store
|
| Fields inherited from interface org.apache.derby.iapi.jdbc.AuthenticationService |
|---|
MODULE |
| Constructor Summary | |
|---|---|
AuthenticationServiceBase()
|
|
| Method Summary | |
|---|---|
Serviceable |
apply(java.lang.String key,
java.io.Serializable value,
java.util.Dictionary p)
Apply a property change. |
boolean |
authenticate(java.lang.String databaseName,
java.util.Properties userInfo)
Authenticate a User inside JBMS.T his is an overload method. |
void |
boot(boolean create,
java.util.Properties properties)
Start this module. |
protected java.lang.String |
encryptPassword(java.lang.String plainTxtUserPassword)
This method encrypts a clear user password using a Single Hash algorithm such as SHA-1 (SHA equivalent) (it is a 160 bits digest) The digest is returned as an object string. |
java.lang.String |
getDatabaseProperty(java.lang.String key)
|
java.lang.String |
getProperty(java.lang.String key)
Returns a property if it was set at the database or system level. |
java.lang.String |
getSystemProperty(java.lang.String key)
|
void |
init(boolean dbOnly,
java.util.Dictionary p)
Initialize the properties for this callback. |
java.io.Serializable |
map(java.lang.String key,
java.io.Serializable value,
java.util.Dictionary p)
Map a proposed new value for a property to an official value. |
protected boolean |
requireAuthentication(java.util.Properties properties)
|
protected void |
setAuthenticationService(UserAuthenticator aScheme)
|
void |
stop()
Stop the module. |
protected java.lang.String |
substitutePassword(java.lang.String userName,
java.lang.String password,
java.util.Properties info,
boolean databaseUser)
Strong Password Substitution (USRSSBPWD). |
boolean |
validate(java.lang.String key,
java.io.Serializable value,
java.util.Dictionary p)
Validate a property change. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.services.monitor.ModuleSupportable |
|---|
canSupport |
| Field Detail |
|---|
protected UserAuthenticator authenticationScheme
private AccessFactory store
public static final java.lang.String AuthenticationTrace
public static final java.lang.String ID_PATTERN_NEW_SCHEME
protected static final int SECMEC_USRSSBPWD
public static final int MAGICLEN_NEWENCRYPT_SCHEME
| Constructor Detail |
|---|
public AuthenticationServiceBase()
| Method Detail |
|---|
protected void setAuthenticationService(UserAuthenticator aScheme)
public void boot(boolean create,
java.util.Properties properties)
throws StandardException
boot in interface ModuleControlStandardException - upon failure to load/boot
the expected authentication service.ModuleControl.boot(boolean, java.util.Properties)public void stop()
ModuleControl
stop in interface ModuleControlModuleControl.stop()
public boolean authenticate(java.lang.String databaseName,
java.util.Properties userInfo)
throws java.sql.SQLException
authenticate in interface AuthenticationServiceuserInfo - Connection properties info.
failure.
java.sql.SQLExceptionAuthenticationService.authenticate(java.lang.String, java.util.Properties)public java.lang.String getProperty(java.lang.String key)
public java.lang.String getDatabaseProperty(java.lang.String key)
public java.lang.String getSystemProperty(java.lang.String key)
public void init(boolean dbOnly,
java.util.Dictionary p)
PropertySetCallbackCode within an init() method should use the 3 argument PropertyUtil method getPropertyFromSet() to obtain a property's value.
init in interface PropertySetCallbackdbOnly - true if only per-database properties are to be looked atp - the complete set of per-database properties.
public boolean validate(java.lang.String key,
java.io.Serializable value,
java.util.Dictionary p)
PropertySetCallback
validate in interface PropertySetCallbackkey - Property key for the property being setvalue - proposed new value for the property being set or null if
the property is being dropped.p - Property set before the change. SettingProperty may read but
must never change p.
PropertySetCallback.validate(java.lang.String, java.io.Serializable, java.util.Dictionary)
public Serviceable apply(java.lang.String key,
java.io.Serializable value,
java.util.Dictionary p)
PropertySetCallback
apply in interface PropertySetCallbackkey - Property key for the property being setvalue - proposed new value for the property being set or null if
the property is being dropped.p - Property set before the change. SettingProperty may read but
must never change p.
PropertySetCallback.validate(java.lang.String, java.io.Serializable, java.util.Dictionary)
public java.io.Serializable map(java.lang.String key,
java.io.Serializable value,
java.util.Dictionary p)
throws StandardException
PropertySetCallback
map in interface PropertySetCallbackkey - Property key for the property being setvalue - proposed new value for the property being set or null if
the property is being dropped.p - Property set before the change. SettingProperty may read but
must never change p.
StandardException - Thrown on error.PropertySetCallback.map(java.lang.String, java.io.Serializable, java.util.Dictionary)protected final boolean requireAuthentication(java.util.Properties properties)
protected java.lang.String encryptPassword(java.lang.String plainTxtUserPassword)
plainTxtUserPassword - Plain text user password
protected java.lang.String substitutePassword(java.lang.String userName,
java.lang.String password,
java.util.Properties info,
boolean databaseUser)
|
Built on Sat 2009-11-28 18:44:18-0800, from revision 885187 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||