private AuthenticatedUser updateAuthenticatedUser(AuthenticatedUser authenticatedUser,
            Credentials credentials) throws GuacamoleAuthenticationProcessException {

        // Get original AuthenticationProvider
        AuthenticationProvider authProvider = authenticatedUser.getAuthenticationProvider();

        try {

            // Re-authenticate the AuthenticatedUser against the original AuthenticationProvider only
            authenticatedUser = authProvider.updateAuthenticatedUser(authenticatedUser, credentials);
            if (authenticatedUser == null)
                throw new GuacamoleSecurityException("User re-authentication failed.");

            return authenticatedUser;

        }
        catch (GuacamoleException | RuntimeException | Error e) {
            throw new GuacamoleAuthenticationProcessException("User re-authentication failed.", authProvider, e);
        }

    }
Re-authenticates the given AuthenticatedUser against the
AuthenticationProvider that originally created it, using the given
Credentials.

@param authenticatedUser
    The AuthenticatedUser to re-authenticate.

@param credentials
    The Credentials to use to re-authenticate the user.

@return
    A AuthenticatedUser which may have been updated due to re-
    authentication.

@throws GuacamoleAuthenticationProcessException
    If an error prevents the user from being re-authenticated.
guacamole/src/main/java/org/apache/guacamole/rest/auth/AuthenticationService.java