`authenticate` filter never gets called

I can think of a few possibilities, though there certainly could be more.

  1. On successful login there is a redirect to the dashboard meaning
    that if you expect to see something output by that function, you
    won’t. Try this:

    add_filter('authenticate', 'my_authenticate', 1000, 2);
    
    function my_authenticate($user, $username){
      var_dump($user, $username);
      die;
      // We never arrive in this function
      return $user;
    }
    

    Login, and you should see output. Remove the die and you won’t see
    anything because the output is wiped out by the redirect, in a
    sense.

  2. The authenticate filter is inside a pluggable function, so it
    is possible that that function has been replaced by the theme or a by a plugin and that filter
    is actually not being called.
  3. You are running your filter late so some earlier filter could
    (though it would be bad form in my opinion) be interrupting things
    before your callback gets a chance to fire– remove_all_filters()
    for example.