简体   繁体   中英

How to communicate between 2 web apps

I have 2 web application developed with diff databases

1) web application with user's all details - app1 2) eCommerce web app - app2

I have to implement a method , such a that when user logins in thru app1 he is able to purchase goods on app2.

Do I have to maintain 2 users tables in 2 different databases.

I also need app1 data in app2,

Do I have to implement REST API with OAuth

You only have to create a web service (REST or SOAP) on app2. Oath is used to delegate user resources to an app therefore there is no need to use it in this case.

The webservice acts as a connection between app1 and the database with goods in the app2. Therefore you will have endpoints such as "get_goods", "buy_goods", "get_details for a product" etc.

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