We have a customer that wants to use their current WordPress site at the “source” for their user table.
(If it makes a difference, the rails app will be the primary app interface for a web front end as well as an iOS and Android front ends.)
So, the user will login through the Website and the idea is that an API call would be made to WordPress with the email/pwd. It would return an authentication successful. I would then issue a token or something like this to the Mobile platforms to allow them continued access.
Any thoughts on how to make the authentication piece work between rails -> wordpress?
In case anyone else wants to accomplish the same thing. Here is how I solved the problem. First, my wordpress instance and rails instances are sitting on the same box, which makes this solution viable.
1) I am using devise for authentication on the rails side. I have created an override for the “authenticate!” method, which checks wordpress.
2) This calls a simple method where I just call over to the wordpress instance to verify the user exists. (I was trying to find a way check the DB table directly, but the WP password hashing isn’t something I wanted to tackle)
3) On the wordpress side (along with some other stuff):