|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.security.auth.spi.AbstractServerLoginModule
org.jboss.security.auth.spi.UsernamePasswordLoginModule
org.jboss.security.auth.spi.DatabaseServerLoginModule
de.rtner.security.auth.spi.SaltedDatabaseServerLoginModule
public class SaltedDatabaseServerLoginModule
A JBoss JDBC based login module that supports authentication, role mapping and salted iterated password hashing. Database connection and SQL are inherited from 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| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.jboss.security.auth.spi.DatabaseServerLoginModule |
|---|
dsJndiName, principalsQuery, rolesQuery, suspendResume, tm, txManagerJndiName |
| Fields inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule |
|---|
callbackHandler, log, loginOk, options, principalClassName, sharedState, subject, unauthenticatedIdentity, useFirstPass |
| Constructor Summary | |
|---|---|
SaltedDatabaseServerLoginModule()
|
|
| Method Summary | ||
|---|---|---|
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
|
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. |
|
| Methods inherited from class org.jboss.security.auth.spi.DatabaseServerLoginModule |
|---|
convertRawPassword, getRoleSets, getTransactionManager, getUsersPassword |
| Methods inherited from class org.jboss.security.auth.spi.UsernamePasswordLoginModule |
|---|
createPasswordHash, getCredentials, getIdentity, getUnauthenticatedIdentity, getUsername, getUsernameAndPassword, getValidateError, login, safeClose, setValidateError |
| Methods inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule |
|---|
abort, addValidOptions, checkOptions, commit, createGroup, createIdentity, getCallerPrincipalGroup, getUseFirstPass, logout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public 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
PBKDF2Parameters| Constructor Detail |
|---|
public SaltedDatabaseServerLoginModule()
| Method Detail |
|---|
public 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.DatabaseServerLoginModule
protected 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 - Parameters
UsernamePasswordLoginModule.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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||