protected int authenticateInternal(Context context,
String username,
String password,
String realm,
HttpServletRequest request,
boolean implicitOnly) {
int bestRet = AuthenticationMethod.BAD_ARGS;
for (AuthenticationMethod aMethodStack : getAuthenticationMethodStack()) {
if (!implicitOnly || aMethodStack.isImplicit()) {
int ret = 0;
try {
ret = aMethodStack.authenticate(context, username, password, realm, request);
} catch (SQLException e) {
ret = AuthenticationMethod.NO_SUCH_USER;
}
if (ret == AuthenticationMethod.SUCCESS) {
updateLastActiveDate(context);
return ret;
}
if (ret < bestRet) {
bestRet = ret;
}
}
}
return bestRet;
}