Securely Transferring Users Between Web Sites

我怕爱的太早我们不能终老 提交于 2019-12-10 15:39:36

问题


Here's the scenario:

  • You have two seperate websites that exist in different environments (I.E. different databases, different web servers/domains)
  • You have full control over the code for both sites, but from the above point, they can not directly communicate with each other's database
  • You must transfer user from site A to site B securely

What is the best way to implement this? Simply sending the user identifier between the sites via query string wouldn't be secure, even if encrypted, since someone else could obtain the URL. It seems like the standard solution is to pass the user identifier along with another temporary key that web site A created, and web site B knows about. If this is the case, what's the proper way of securely setting up the system with the temporary key?

Thanks!


回答1:


Write a web-service call over HTTPS, at both ends, to retrieve the users details, and that only works for a specific login-pair. Problem solved. You need to make the login-id's at both ends uniform or use single sign on cookies. More details in the paper by Vipin Samar: "Single Sign on Cookies for Web Applications".

They can't get the URL/Passwords unless they go into the application code at one of the servers.




回答2:


I am doing something like this. The best thing I can think of right now is passing a HASH of the user ID, or if that makes you worry, the hash of some other user data.

If yuo want temporary keys(I might do something like this too), how about setting up a web service on A that B can call to to get the user ID based on the temporary key. This way it's a totally separate call, and can be secured.




回答3:


Take a look at "Pass-through Authentication," its a concept that allows a user's identity to be passed from one system to another.

Additionally, another idea that you may want to try is to create a secure token that does not expose the user's information and pass it on. However, this requires both systems to have similar data to verify the token. As the other answer suggested, hashes are very good uses to create non-descriptive bits about sensitive information.




回答4:


You need to pass information between Site A and Site B, but you don't need to make the user the conduit for that information.

Site B could have a web-service that allows Site A to create a session for the user. In this design the interaction would go as follows:

  • User clicks button on Site A
  • Site A calls web-service on Site B which passes a temporary login URL back to Site A
  • Site A redirects user to the temporary URL on Site B


来源:https://stackoverflow.com/questions/1868415/securely-transferring-users-between-web-sites

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!