简体   繁体   中英

How to share authentication info between wordpress site and a rails app?

Here's what we are trying to do:

  1. Application "X" is on wordpress hosted on example.com
  2. Application "Y" is built in RoR (ruby 2, rails 4) hosted on form.example.com. It uses 'devise' for managing authentication.
  3. On Application "X", we need to show a login form (email, password, submit button) in a corner of the page. The form is loaded from Application "Y" and submitted back to it.
  4. If login is successful, username is fetched from 'Y" and shown on "X". If login is unsuccessful, error message shown on "X". All this should happen without leaving example.com
  5. If the user closes the window and comes back to this page later on, the session should be read from "Y" and current login status should be shown.

Any pointers greatly appreciated.

Your question might as well be How Do I Write An API?

What you're asking is how to not only port data, but also functionality (authentication) between two different applications. Whilst this is entirely feasible with an API (Application Programming Interface) , the trick lies in creating the relationship between the two

Wordpress has its own authentication system, and Devise has its own as well. The problem is helping both of these applications "talk" to each other


If you'd like me to give some ideas about how to write an API for this, please let me know. Otherwise, I would recommend looking what you're actually trying to achieve -- it might be right to stick to one framework or the other

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM