I want to verify email id and password with external API before the wordpress authentication. I have used filters to get it done but its authenticate with wordpress first.
add_filter( 'authenticate', 'verify_auth', 20, 3 );
function verify_auth( $user, $username, $password ){
}