protected void authenticateUser() throws LoginException {
        if (!(_currentRealm instanceof MultipleLoginRealm)) {
            String msg = sm.getString("jdbclm.badrealm");
            throw new LoginException(msg);
        }
        
        final MultipleLoginRealm jdbcRealm = (MultipleLoginRealm)_currentRealm;

        // A JDBC user must have a name not null and non-empty.
        if ( (_username == null) || (_username.length() == 0) ) {
            String msg = sm.getString("jdbclm.nulluser");
            throw new LoginException(msg);
        }

        _username = jdbcRealm.getActualLogin(_username.toLowerCase());
        
        String[] grpList = jdbcRealm.authenticate(_username, getPasswordChar());

        if (grpList == null) {  // JAAS behavior
            String msg = sm.getString("jdbclm.loginfail", _username);
            throw new LoginException(msg);
        }

        if (_logger.isLoggable(Level.FINEST)) {
            _logger.log(Level.FINEST, "JDBC login succeeded for: {0} groups:{1}",
                new Object[]{_username, Arrays.toString(grpList)});
        }
        
        commitUserAuthentication(grpList);
    }