GUACAMOLE-990: Use translation string for "too many failed attempts" error.

This commit is contained in:
Michael Jumper
2022-08-22 09:40:10 -07:00
parent f9d8abcfde
commit 2b19bc95da
3 changed files with 13 additions and 3 deletions

View File

@@ -22,9 +22,9 @@ package org.apache.guacamole.auth.ban;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import javax.servlet.http.HttpServletRequest;
import org.apache.guacamole.GuacamoleClientTooManyException;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.GuacamoleServerException;
import org.apache.guacamole.language.TranslatableGuacamoleClientTooManyException;
import org.apache.guacamole.net.auth.Credentials;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -207,8 +207,9 @@ public class AuthenticationFailureTracker {
// if too many failures have occurred
if (status.isBlocked()) {
logger.debug("Blocking authentication attempt from address \"{}\" due to number of authentication failures.", address);
throw new GuacamoleClientTooManyException("Too many failed "
+ "authentication attempts. Please try again later.");
throw new TranslatableGuacamoleClientTooManyException("Too "
+ "many failed authentication attempts.",
"LOGIN.ERROR_TOO_MANY_ATTEMPTS");
}
// Clean up tracking of failures if the address is no longer

View File

@@ -11,6 +11,10 @@
"listeners" : [
"org.apache.guacamole.auth.ban.BanningAuthenticationListener"
],
"translations" : [
"translations/en.json"
]
}

View File

@@ -0,0 +1,5 @@
{
"LOGIN": {
"ERROR_TOO_MANY_ATTEMPTS" : "Too many failed authentication attempts. Please try again later."
}
}