开发者

Logging into Multiple sites

开发者 https://www.devze.com 2023-01-19 00:07 出处:网络
I have two different websites written in Rails(W1) andPHP(W2) both on different hosts. I used Authlogic for W1\'s authetication now I wa开发者_如何学JAVAnt to allow user

I have two different websites written in Rails(W1) and PHP(W2) both on different hosts. I used Authlogic for W1's authetication now I wa开发者_如何学JAVAnt to allow user of W1 to login into W2 using same username and password (as of W2). How can I do this?


The essence of the answer is that you need to somehow pass an authentication token to the php website. The way how you can do this differs. For example you can write a web-service on top of rails website, which php website would use to check supplied user credentials.

The other way is to manage a connection from php website to rails website database, and write a copy of authlogic authentication logic in php. It is not going to be very time consuming.

In Rails db you should operate with these fields of users table: login (email), password, salt, persistence_token.

0

精彩评论

暂无评论...
验证码 换一张
取 消