Login in WordPress using external database data
You can override the core wp_authenticate function. You would need to create a custom plugin and declare a new version of wp_authenticate. The function accepts a username and a password and returns a WP $user object. wp_authenticate is a ‘pluggable’ function and it is found in the wp-includes/pluggable.php file.