|
||||||||||
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
public class DatabaseServerLoginModule
A JDBC based login module that supports authentication and role mapping. It is based on two logical tables:
LoginModule options:
"select Password from Principals where PrincipalID=?"
"select Role, RoleGroup from Roles where PrincipalID=?"
Field Summary | |
---|---|
protected String |
dsJndiName
The JNDI name of the DataSource to use |
protected String |
principalsQuery
The sql query to obtain the user password |
protected String |
rolesQuery
The sql query to obtain the user roles |
protected boolean |
suspendResume
Whether to suspend resume transactions during database operations |
Fields inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule |
---|
callbackHandler, log, loginOk, options, principalClassName, sharedState, subject, unauthenticatedIdentity, useFirstPass |
Constructor Summary | |
---|---|
DatabaseServerLoginModule()
|
Method Summary | |
---|---|
protected String |
convertRawPassword(String rawPassword)
A hook to allow subclasses to convert a password from the database into a plain text string or whatever form is used for matching against the user input. |
protected Group[] |
getRoleSets()
Execute the rolesQuery against the dsJndiName to obtain the roles for the authenticated user. |
protected String |
getUsersPassword()
Get the expected password for the current username available via the getUsername() method. |
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map sharedState,
Map options)
Initialize this LoginModule. |
Methods inherited from class org.jboss.security.auth.spi.UsernamePasswordLoginModule |
---|
createPasswordHash, getCredentials, getIdentity, getUnauthenticatedIdentity, getUsername, getUsernameAndPassword, getValidateError, login, setValidateError, validatePassword |
Methods inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule |
---|
abort, commit, createGroup, createIdentity, getUseFirstPass, logout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String dsJndiName
protected String principalsQuery
protected String rolesQuery
protected boolean suspendResume
Constructor Detail |
---|
public DatabaseServerLoginModule()
Method Detail |
---|
public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
initialize
in interface LoginModule
initialize
in class UsernamePasswordLoginModule
options
- -
dsJndiName: The name of the DataSource of the database containing the
Principals, Roles tables
principalsQuery: The prepared statement query, equivalent to:
"select Password from Principals where PrincipalID=?"
rolesQuery: The prepared statement query, equivalent to:
"select Role, RoleGroup from Roles where PrincipalID=?"subject
- the Subject to update after a successful login.callbackHandler
- the CallbackHandler that will be used to obtain the
the user identity and credentials.sharedState
- a Map shared between all configured login module instancesprotected String getUsersPassword() throws LoginException
getUsersPassword
in class UsernamePasswordLoginModule
LoginException
protected Group[] getRoleSets() throws LoginException
getRoleSets
in class AbstractServerLoginModule
LoginException
protected String convertRawPassword(String rawPassword)
rawPassword
- - the password as obtained from the database
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |