GUACAMOLE-611: Advise administrator to set "skip-if-unavailable" if similar internal errors should be tolerated in the future.

This commit is contained in:
Michael Jumper
2018-08-25 13:27:44 -07:00
parent 8fae19dee9
commit cc742f2143
2 changed files with 24 additions and 1 deletions

View File

@@ -154,6 +154,25 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
}
/**
* Logs a warning that the authentication process will be entirely aborted
* due to an internal error, advising the administrator to set the
* "skip-if-unavailable" property if error encountered is expected and
* should be tolerated.
*/
private void warnAuthAborted() {
String identifier = getIdentifier();
logger.warn("The \"{}\" authentication provider has encountered an "
+ "internal error which will halt the authentication "
+ "process. If this is unexpected or you are the developer of "
+ "this authentication provider, you may wish to enable "
+ "debug-level logging. If this is expected and you wish to "
+ "ignore such failures in the future, please set \"{}: {}\" "
+ "within your guacamole.properties.",
identifier, ExtensionModule.SKIP_IF_UNAVAILABLE.getName(),
identifier);
}
@Override
public AuthenticatedUser authenticateUser(Credentials credentials)
throws GuacamoleException {
@@ -186,6 +205,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
return null;
}
warnAuthAborted();
throw e;
}
@@ -198,6 +218,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
return null;
}
warnAuthAborted();
throw e;
}
@@ -251,6 +272,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
return null;
}
warnAuthAborted();
throw e;
}
@@ -263,6 +285,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
return null;
}
warnAuthAborted();
throw e;
}

View File

@@ -93,7 +93,7 @@ public class ExtensionModule extends ServletModule {
* providers that are not within this list will halt the authentication
* process entirely.
*/
private final StringSetProperty SKIP_IF_UNAVAILABLE = new StringSetProperty() {
public static final StringSetProperty SKIP_IF_UNAVAILABLE = new StringSetProperty() {
@Override
public String getName() {