|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjhomenet.security.RdbmsLoginModule
public class RdbmsLoginModule
RdbmsLoginModule is a LoginModule that authenticates a given username/password credential against a JDBC datasource.
This LoginModule interoperates with
any conformant JDBC datasource. To direct this
LoginModule to use a specific JNDI datasource,
two options must be specified in the login Configuration
for this LoginModule.
url=jdbc_url
driverb>jdbc driver class
For the purposed of this example, the format in which the user's information must be stored in the database is in a table named "USER_AUTH" with the following columns
USERID
PASSWORD
FIRST_NAME
LAST_NAME
DELETE_PERM
UPDATE_PERM
LoginModule| Constructor Summary | |
|---|---|
RdbmsLoginModule()
Default constructor. |
|
| Method Summary | |
|---|---|
boolean |
abort()
This method is called if the LoginContext's overall authentication failed. |
boolean |
commit()
Abstract method to commit the authentication process (phase 2). |
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)
|
boolean |
login()
Verify the password against the relevant JDBC datasource. |
boolean |
logout()
Logout a user. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RdbmsLoginModule()
| 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.LoginModuleLoginModule.initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)
public boolean login()
throws javax.security.auth.login.LoginException
login in interface javax.security.auth.spi.LoginModulejavax.security.auth.login.LoginExceptionLoginModule.login()
public boolean commit()
throws javax.security.auth.login.LoginException
This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded).
If this LoginModule's own authentication attempt
succeeded (checked by retrieving the private state saved by the
login method), then this method associates a
RdbmsPrincipal
with the Subject located in the
LoginModule. If this LoginModule's own
authentication attempted failed, then this method removes
any state that was originally saved.
commit in interface javax.security.auth.spi.LoginModulejavax.security.auth.login.LoginExceptionLoginModule.commit()
public boolean abort()
throws javax.security.auth.login.LoginException
This method is called if the LoginContext's overall authentication failed. (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules did not succeed).
If this LoginModule's own authentication attempt
succeeded (checked by retrieving the private state saved by the
login and commit methods),
then this method cleans up any state that was originally saved.
abort in interface javax.security.auth.spi.LoginModulejavax.security.auth.login.LoginExceptionLoginModule.abort()
public boolean logout()
throws javax.security.auth.login.LoginException
This method removes the Principals
that were added by the commit method.
logout in interface javax.security.auth.spi.LoginModulejavax.security.auth.login.LoginExceptionLoginModule.logout()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||