|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.security.auth.spi.AbstractServerLoginModule (src)
org.jboss.security.auth.spi.UsernamePasswordLoginModule (src)
org.jboss.security.auth.spi.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 java.lang.String |
dsJndiName
The JNDI name of the DataSource to use |
protected java.lang.String |
principalsQuery
The sql query to obtain the user password |
protected java.lang.String |
rolesQuery
The sql query to obtain the user roles |
Fields inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule (src) |
callbackHandler, log, loginOk, options, principalClassName, sharedState, subject, unauthenticatedIdentity, useFirstPass |
Constructor Summary | |
DatabaseServerLoginModule()
|
Method Summary | |
protected java.lang.String |
convertRawPassword(java.lang.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 java.security.acl.Group[] |
getRoleSets()
Execute the rolesQuery against the dsJndiName to obtain the roles for the authenticated user. |
protected java.lang.String |
getUsersPassword()
Get the expected password for the current username available via the getUsername() method. |
void |
initialize(javax.security.auth.Subject subject,
javax.security.auth.callback.CallbackHandler callbackHandler,
java.util.Map sharedState,
java.util.Map options)
Initialize this LoginModule. |
Methods inherited from class org.jboss.security.auth.spi.UsernamePasswordLoginModule (src) |
createPasswordHash, getCredentials, getIdentity, getUnauthenticatedIdentity, getUsername, getUsernameAndPassword, login, validatePassword |
Methods inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule (src) |
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 java.lang.String dsJndiName
protected java.lang.String principalsQuery
protected java.lang.String rolesQuery
Constructor Detail |
public DatabaseServerLoginModule()
Method Detail |
public void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map sharedState, java.util.Map options)
initialize
in interface javax.security.auth.spi.LoginModule
initialize
in class UsernamePasswordLoginModule (src)
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=?"protected java.lang.String getUsersPassword() throws javax.security.auth.login.LoginException
getUsersPassword
in class UsernamePasswordLoginModule (src)
javax.security.auth.login.LoginException
protected java.security.acl.Group[] getRoleSets() throws javax.security.auth.login.LoginException
getRoleSets
in class AbstractServerLoginModule (src)
javax.security.auth.login.LoginException
protected java.lang.String convertRawPassword(java.lang.String rawPassword)
rawPassword
- - the password as obtained from the database
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |