Object credentials,
Request request)
{
try
{
AbstractCallbackHandler callbackHandler = null;
//user has not been authenticated
if (callbackHandlerClass == null)
{
Log.warn("No CallbackHandler configured: using DefaultCallbackHandler");
callbackHandler = new DefaultCallbackHandler();
}
else
{
callbackHandler = (AbstractCallbackHandler)Loader.loadClass(JAASUserRealm.class, callbackHandlerClass).getConstructors()[0].newInstance(new Object[0]);
}
if (callbackHandler instanceof DefaultCallbackHandler)
{
((DefaultCallbackHandler)callbackHandler).setRequest (request);
}
callbackHandler.setUserName(username);
callbackHandler.setCredential(credentials);
//set up the login context
LoginContext loginContext = new LoginContext(loginModuleName,
callbackHandler);