mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
GUAC-1364: Invalidate session after token has been invalidated.
This commit is contained in:
@@ -35,6 +35,7 @@ import org.glyptodon.guacamole.GuacamoleSecurityException;
|
|||||||
import org.glyptodon.guacamole.GuacamoleUnauthorizedException;
|
import org.glyptodon.guacamole.GuacamoleUnauthorizedException;
|
||||||
import org.glyptodon.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException;
|
import org.glyptodon.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException;
|
||||||
import org.glyptodon.guacamole.net.auth.credentials.GuacamoleInvalidCredentialsException;
|
import org.glyptodon.guacamole.net.auth.credentials.GuacamoleInvalidCredentialsException;
|
||||||
|
import org.glyptodon.guacamole.net.basic.GuacamoleSession;
|
||||||
import org.glyptodon.guacamole.net.basic.rest.auth.TokenSessionMap;
|
import org.glyptodon.guacamole.net.basic.rest.auth.TokenSessionMap;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -177,8 +178,11 @@ public class RESTExceptionWrapper implements MethodInterceptor {
|
|||||||
String token = getAuthenticationToken(invocation);
|
String token = getAuthenticationToken(invocation);
|
||||||
|
|
||||||
// If there is an associated auth token, invalidate it
|
// If there is an associated auth token, invalidate it
|
||||||
if (token != null && tokenSessionMap.remove(token) != null)
|
GuacamoleSession session = tokenSessionMap.remove(token);
|
||||||
logger.debug("Implicitly invalidated token \"{}\" due to GuacamoleUnauthorizedException.", token);
|
if (session != null) {
|
||||||
|
session.invalidate();
|
||||||
|
logger.debug("Implicitly invalidated session for token \"{}\".", token);
|
||||||
|
}
|
||||||
|
|
||||||
// Continue with exception processing
|
// Continue with exception processing
|
||||||
throw e;
|
throw e;
|
||||||
|
Reference in New Issue
Block a user