if (context == null) {//TODO: throw an exception
throw new ServletException("Internal error: Context null");
}
final AuthenticatorBase authBase = (AuthenticatorBase) context.getAuthenticator();
if (authBase == null) {
throw new ServletException("Internal error: Authenticator null");
}
byte[] alreadyCalled = (byte[]) reentrancyStatus.get();
if (alreadyCalled[0] == 1) {
//Re-entrancy from a JSR 196 module, so call the authenticate directly
try {
return authBase.authenticate(this, (HttpResponse) getResponse(),
context.getLoginConfig());
} catch (Exception ex) {
throw new ServletException("Exception thrown while attempting to authenticate", ex);
}