|
||||||||||
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
This is the authentication service base class.
There can be 1 Authentication Service for the whole Cloudscape 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 |
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. |
static byte[] |
toHexByte(java.lang.String str,
int offset,
int length)
Convert a string into a byte array in hex format. |
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
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 ModuleControl
StandardException
- upon failure to load/boot
the expected authentication service.ModuleControl.boot(boolean, java.util.Properties)
public void stop()
ModuleControl
stop
in interface ModuleControl
ModuleControl.stop()
public boolean authenticate(java.lang.String databaseName, java.util.Properties userInfo) throws java.sql.SQLException
authenticate
in interface AuthenticationService
userInfo
- Connection properties info.
failure.
java.sql.SQLException
AuthenticationService.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)
PropertySetCallback
Code within an init() method should use the 3 argument PropertyUtil method getPropertyFromSet() to obtain a property's value.
init
in interface PropertySetCallback
dbOnly
- 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 PropertySetCallback
key
- 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 PropertySetCallback
key
- 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 PropertySetCallback
key
- 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
public static byte[] toHexByte(java.lang.String str, int offset, int length)
b & 0xf0
),
the second byte
represents the low nibble (b & 0x0f
).
str.charAt(0)
is represented by the first two bytes
in the returned String.
str
- stringoffset
- starting character (zero based) to convert.length
- number of characters to convert.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |