[wp-hackers] Integrate site authentication with WordPress
beau at dentedreality.com.au
Wed Dec 2 19:38:41 UTC 2009
> This article works if I want to let WordPress do the authentication but I
> want the rails site to handle the authentication. I want the user to
> be automatically logged in to WordPress when they log in on the rails site.
You'll need to ensure that your passwords are always kept in sync
between the 2 DBs then, and also have your Rails app generate cookies
that match up with WP in that case (probably in addition to whatever
you're already doing). Take a look at how the functions work in
pluggable.php ( wp_*_auth_cookie() functions ).
Have a look at wp-includes/class-phpass.php for the hashing mechanism
used in WP to store passwords these days, and check out
wp_hash_password() (also in pluggable.php) to see it in action.
Alternatively, you could override all those functions with your own
versions that match more closely to your current Rails implementation
(since they're all in pluggable to specifically allow you to override
them in a plugin).
More information about the wp-hackers