Maybe I'm not good at searching for good references about this since all searches I've found are related to "callback functions" not related to package javax.security.auth.callback package.
Please can anyone explain me the purpose of this package and its subclasses?
Only thing I know is that it is used for authentication information exchange between modules, but why?
Please let me know if this question is not appropriate and advise me to delete it.
This package is part of JAAS (Java Authentication and Authorization Service), and provides mechanisms for an authenticator to obtain user-derived information from the user. The callback objects defined in this package can serve as wrappers to send the various pieces of information into the system. For more information, this tutorial on JAAS and callbacks may be interesting reading.