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

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

        // 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;

    }
private AuthenticatedUser updateAuthenticatedUser ( AuthenticatedUser authenticatedUser , Credentials credentials ) throws GuacamoleException { AuthenticationProvider authProvider = authenticatedUser . getAuthenticationProvider ( ) ; authenticatedUser = authProvider . updateAuthenticatedUser ( authenticatedUser , credentials ) ; if ( authenticatedUser == null ) throw new GuacamoleSecurityException ( "User re-authentication failed." ) ; return authenticatedUser ; }
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 GuacamoleException
If an error prevents the user from being re-authenticated.