{
boolean preemptive = Boolean.parseBoolean(getServletContext().getInitParameter(GS.preemptiveAuth.getURI()).toString());
if (preemptive)
{
if (log.isDebugEnabled()) log.debug("Creating PreemptiveBasicAuthenticator for Context {} with username: {} ", serviceContext, usr);
return new PreemptiveBasicAuthenticator(new SimpleAuthenticator(usr, pwd.toCharArray()));
}
}
if (log.isDebugEnabled()) log.debug("Creating SimpleAuthenticator for Context {} with username: {} ", serviceContext, usr);
return new SimpleAuthenticator(usr, pwd.toCharArray());
}
return null;
}