I have a WP site and also have a external DB (means not WP DB) with users. The insertion process at that table uses the same algorithm as WP uses. What I’m need to do here is login in WP but using this external DB which is in the same host by the way. I check this links http://www.tyssendesign.com.au/articles/cms/connecting-to-external-database-from-within-wordpress/ and http://wordpress.org/extend/plugins/external-database-authentication/ and for the first is not what I’m want but for the second one is not compatible with WP 3+ and I’m using 3.3.1, any suggestion or docs or something else?
5 Answers
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.