Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : Java : Education - Tutorials
Java security, Part 2: Authentication and authorization
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
3. Authentication in JAAS
  


The callback handler page 9 of 13


The JAAS login uses a callback handler to get authentication information from users. The CallbackHandler is specified in the constructor of the LoginContext object. In this tutorial, the callback handler employs several prompts to get username and password information from the user. The handler's handle() method, which is called from a login module, takes an array of Callback objects as its parameter. During login, the handler iterates through the array of Callbacks. The handle() method examines the type of the Callback object and performs the appropriate user action. Callback types are as follows:

  • NameCallback
  • PasswordCallback
  • TextInputCallback
  • TextOutputCallback
  • LanguageCallback
  • ChoiceCallback
  • ConfirmationCallback

In some applications, no user interaction is required because JAAS will be used to interface to the operating system's authentication mechanism. In such cases, the CallbackHandler parameter in the LoginContext object will be null.


Main menuSection menuFeedbackPreviousNext
Privacy Legal Contact