|
VLJ Iteration II, v. 1.0.0.193 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.va.med.foundations.security.vistalink.VistaLoginModule
A JAAS-compliant LoginModule to log users on to a Vista system. An application never needs to access the
VistaLoginModule class directly. Rather, as a JAAS login module, its methods are invoked indirectly by an application
through the JAAS login context class (javax.security.auth.login.LoginContext
).
The key classes for invoking a login with this login module are:
CallbackHandlerSwing
or CallbackHandlerUnitTest
VistaLoginModuleConfiguation
javax.security.auth.login.LoginContext
)
VistaKernelPrincipalImpl
)
String jaasCfgName = "RpcSampleServer"; // create the callback handler CallbackHandlerSwing cbhSwing = new CallbackHandlerSwing(myFrame); // create the LoginContext loginContext = new LoginContext(jaasCfgName, cbhSwing); // login to server loginContext.login();An example logout:
// logout of the server loginContext.logout();
CallbackHandlerSwing
,
CallbackHandlerUnitTest
,
VistaKernelPrincipal
,
VistaKernelPrincipalImpl
Field Summary | |
static java.lang.String |
SERVER_ADDRESS_KEY
map key to store/retrieve server IP address for the VistaLoginModule configuration option map. |
static java.lang.String |
SERVER_PORT_KEY
map key to store/retrieve server port for the VistaLoginModule configuration option map. |
Constructor Summary | |
VistaLoginModule()
|
Method Summary | |
boolean |
abort()
Should never be called by an application directly. |
boolean |
commit()
Should never be called by an application directly. |
void |
initialize(javax.security.auth.Subject subject,
javax.security.auth.callback.CallbackHandler callbackHandler,
java.util.Map sharedState,
java.util.Map options)
Should never be called by an application directly. |
boolean |
login()
Should never be called by an application directly. |
boolean |
logout()
Should never be called by an application directly. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SERVER_ADDRESS_KEY
VistaLoginModule
configuration option map.
You need these keys to pass login options from a JAAS configuration to the VistaLoginModule.
Use the values of these keys as the keys in which to set the server IP address
and server port into the configuration options that are passed back to VistaLoginModule
.
public static final java.lang.String SERVER_PORT_KEY
VistaLoginModule
configuration option map.
You need these keys to pass login options from a JAAS configuration to the VistaLoginModule.
Use the values of these keys as the keys in which to set the server IP address
and server port into the configuration options that are passed back to VistaLoginModule
.
Constructor Detail |
public VistaLoginModule()
Method Detail |
public void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map sharedState, java.util.Map options)
Part of the JAAS interface for a login module; initializes the login module.
initialize
in interface javax.security.auth.spi.LoginModule
subject
- the subject to be authenticated.callbackHandler
- a callback handler for communicating with the end user. The
VistaLoginModule login module does not make use of this.sharedState
- state shared with other configuration login modules. Not used by
the VistaLoginModule login module.options
- This is where the configuration options passed to the LoginContext are
then passed to the LoginModule.public boolean login() throws VistaLoginModuleException, VistaLoginModuleLoginsDisabledException, VistaLoginModuleNoJobSlotsAvailableException, VistaLoginModuleNoPathToListenerException, VistaLoginModuleTooManyInvalidAttemptsException, VistaLoginModuleUserCancelledException, VistaLoginModuleUserTimedOutException
When an application invokes login() on the LoginContext, the LoginContext calls this method to initiate a login to a VistaLink M server. Once a successful login has occurred, the authenticated connection will be stored in the JAAS subject, in a VistaKernelPrincipal.
login
in interface javax.security.auth.spi.LoginModule
VistaLoginModuleException
- a VistaLoginModuleException is thrown if the login for this module fails.
VistaLoginModuleLoginsDisabledException
- thrown if logins are disabled
VistaLoginModuleNoJobSlotsAvailableException
- thrown if no job slots are available
VistaLoginModuleNoPathToListenerException
- thrown if the specified listener can't be reached
VistaLoginModuleTooManyInvalidAttemptsException
- thrown if too many bad login attempts are made
VistaLoginModuleUserCancelledException
- thrown if user cancels the login
VistaLoginModuleUserTimedOutException
- thrown if user times out of the loginpublic boolean commit() throws javax.security.auth.login.LoginException
Part of the JAAS interface for a login module. Since we don't have a two-phase login, this always returns true (and is irrelevant to the success or failure of a login).
commit
in interface javax.security.auth.spi.LoginModule
javax.security.auth.login.LoginException
- this is never thrown by this implementation of commit().public boolean abort() throws VistaLoginModuleException
Part of the JAAS interface for a login module. This loginmodule's implementation of this method calls M to cleanly shut down the connection to M. If we were to support an environment with multiple login modules, and the login for one of them failed, this method would be called to do any cleanup to back out of a partial login, which in the case of VistaLink, means clean up/tear down the existing connection to M.
abort
in interface javax.security.auth.spi.LoginModule
VistaLoginModuleException
- thrown if logging out on the M side fails.public boolean logout() throws VistaLoginModuleException
For applications to call, to logout a user from an open connection/session to a VistaLink M server. Doing this drops the connection, freeing up resources on the M server.
logout
in interface javax.security.auth.spi.LoginModule
VistaLoginModuleException
- thrown if the logout fails on the M side.
|
VLJ Iteration II, v. 1.0.0.193 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |