public class SaltedDatabaseServerLoginModule
extends org.jboss.security.auth.spi.DatabaseServerLoginModule
Actual check is deferred to pluggable cryptographic module.
Format of password depends on formatter. Default PBKDF2HexFormatter's format is: Salt(Hex):Iteration Count(decimal):hashed password(Hex)
DatabaseServerLoginModule| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
DEFAULT_ENGINE
The default engine to use if not specified as a property.
|
java.lang.String |
DEFAULT_FORMATTER
The default formatter to use if not specified as a property.
|
java.lang.String |
DEFAULT_PARAMETER
The default engine parameter class to use if not specified as a property.
|
protected java.lang.String |
engineClassName
Class name of PBKDF2 engine to use.
|
protected PBKDF2Formatter |
formatter
Instantiation of formatter class.
|
protected java.lang.String |
formatterClassName
Class name of formatter to use.
|
protected java.lang.String |
hashAlgorithm
The message digest algorithm used to hash passwords (examples: HMacSHA1,
HMacMD5).
|
protected java.lang.String |
hashCharset
The name of the charset/encoding to use when converting the password
String to a byte array.
|
protected java.lang.String |
parameterClassName
Class name of PBKDF2 engine parameters to use.
|
| Constructor and Description |
|---|
SaltedDatabaseServerLoginModule() |
| Modifier and Type | Method and Description |
|---|---|
protected PBKDF2 |
getEngine(PBKDF2Parameters parameters)
Factory method: instantiate the PBKDF2 engine.
|
protected PBKDF2Parameters |
getEngineParameters()
Factory method: instantiate the PBKDF2 engine parameters.
|
protected PBKDF2Formatter |
getFormatter()
Factory method: instantiate the PBKDF2 formatter.
|
void |
initialize(javax.security.auth.Subject subject,
javax.security.auth.callback.CallbackHandler callbackHandler,
java.util.Map<java.lang.String,?> sharedState,
java.util.Map<java.lang.String,?> options) |
protected <T> T |
newInstance(java.lang.String name,
java.lang.Class<T> clazz)
Generic helper: Use JBoss SecurityActions to load a class, then create a new instance.
|
protected boolean |
validatePassword(java.lang.String inputPassword,
java.lang.String expectedPassword)
Actual salt-enabled verification function.
|
convertRawPassword, getRoleSets, getTransactionManager, getUsersPasswordcreatePasswordHash, getCredentials, getIdentity, getUnauthenticatedIdentity, getUsername, getUsernameAndPassword, getValidateError, login, safeClose, setValidateErrorpublic final java.lang.String DEFAULT_FORMATTER
public final java.lang.String DEFAULT_ENGINE
public final java.lang.String DEFAULT_PARAMETER
protected java.lang.String hashAlgorithm
protected java.lang.String hashCharset
protected java.lang.String formatterClassName
PBKDF2Formatter,
PBKDF2HexFormatterprotected PBKDF2Formatter formatter
protected java.lang.String engineClassName
PBKDF2protected java.lang.String parameterClassName
PBKDF2Parameterspublic void initialize(javax.security.auth.Subject subject,
javax.security.auth.callback.CallbackHandler callbackHandler,
java.util.Map<java.lang.String,?> sharedState,
java.util.Map<java.lang.String,?> options)
initialize in interface javax.security.auth.spi.LoginModuleinitialize in class org.jboss.security.auth.spi.DatabaseServerLoginModuleprotected boolean validatePassword(java.lang.String inputPassword,
java.lang.String expectedPassword)
validatePassword in class org.jboss.security.auth.spi.UsernamePasswordLoginModuleinputPassword - Password that was supplied by user (candidate password)expectedPassword - Actually the encoded PBKDF2 string which contains the
expected/reference password implicitly. Not a clear-text
password. Parameter is named like this because of inherited
method parameter name.true if the inputPassword is valid, false otherwise.protected PBKDF2Parameters getEngineParameters()
UsernamePasswordLoginModule.setValidateError(Throwable) and returns
null.protected PBKDF2 getEngine(PBKDF2Parameters parameters)
parameters - ParametersUsernamePasswordLoginModule.setValidateError(Throwable) and returns
null.protected PBKDF2Formatter getFormatter()
UsernamePasswordLoginModule.setValidateError(Throwable) and returns
null.protected <T> T newInstance(java.lang.String name,
java.lang.Class<T> clazz)
T - generic return typename - FQCN of the class to instantiate.clazz - Expected type, used for PicketBox logging.UsernamePasswordLoginModule.setValidateError(Throwable) and returns
null.