|
|||||||||
|
Passing Shared Security Token Between Login Modules
JAAS defines a LoginContext class, which provides a context for all login modules defined for an application. Its login method iterates through all login modules and calls each login module's login method. It determines the overall authentication result by combining the results of the login method returned from each login module.
In the login method of LoginContext, each login module defined in the configuration file is instantiated and then is passed four parameters using the initialize method of the login module (See Listing 2, exception checking is omitted for smaller code). The following are the four parameters the initialize method passes: The shared state map parameter is key to implementing single sign-on. After the first login module captures the user credential information, such as user name and password, it puts the information into the shared state map and passes it to other login modules on the list. The other login module has an optional parameter specified (useSharedState=true), so it simply gets the shared security information back and authenticates against its own security data store. Listing 3 shows a code excerpt for the LoginModule that implements this (exception checking has been omitted to reduce the length of the code segment).
ReMapping of Security Information In their paper, "Making Login Services Independent of Authentication Technologies", Vipin Samar and Charlie Lai proposed a mapping mechanism that solves this problem. This mapping enables the user's primary password to be used for encrypting the user's secondary passwords. Once the primary password is verified, the login module obtains the password by decrypting the mechanism-specific encrypted password with the primary password. It then authenticates it to its data store. How the password is encrypted depends completely on the module implementation. To use password mapping, Samar and Lai also suggest two more optional attributes be passed to the login module:
Shared Map Is Key
|
|||||||||
|
James Tao is a senior software engineer at Cysive, working on the JAAS security module for its interaction server, Cysive Cymbio. James is a Sun-certified Java programmer/developer, J2EE architect, and BEA Weblogic Server 6.0-certified developer with more than 10 years of experience developing client/server software and multi-tier applications using C++, Visual C++. and J2SE/J2EE. Reach him by e-mail at jtao@cysive.com
| |||||||||
|