Suppose there are now two websites, A and B, which provide services for the same user (C. Now, C logs on to the webpage provided by Company A and enters the user name and password in the login form. When you enter the user name, the browser asynchronously requests data. The available user name is displayed in real time below the form. The data is B website server... suppose there are now two websites, A and B, which provide services for the same user (C.
Now, C Login
CompanyEnter the user name and password in the logon form.
When you enter the user name, the browser asynchronously requests data. The available user name is displayed below the form in real time. This data is returned by website B server (A does not have control of website B server ).
After the input is complete, press enter to trigger the form submission event. At the time of submission, the user name is sent to website A, and the password is locally hashed and then sent to website B.
The above implementation does not need to be detailed.
Reply content:
Suppose there are now two websites, A and B, which provide services for the same user (C.
Now, C LoginCompanyEnter the user name and password in the logon form.
When you enter the user name, the browser asynchronously requests data. The available user name is displayed below the form in real time. This data is returned by website B server (A does not have control of website B server ).
After the input is complete, press enter to trigger the form submission event. At the time of submission, the user name is sent to website A, and the password is locally hashed and then sent to website B.
The above implementation does not need to be detailed.
You can use the following two methods:
-
Use CORS (Cross-origin resource sharing)
You need to add CORS headers to the headers returned by website B's requests, and add the domain of website A to Access-Control-Allow-Origin. Cross-origin reference: http://blog.csdn.net/qgw_2000/article/details/8882051
-
Send A request to website B through website A proxy
Requests are sent to website A and forwarded to requests from website B. In nginx, you can simply use proxy_pass.
This is notxssWell, server B sets it to accept cross-domain requests from Domain.
If you understand the server configuration, we recommend that you use the second method on the second floor. If you do not understand it, you can also use php curl. The frontend forms are asynchronously submitted to site, site A accesses Site B through curl (or simulates the submission form) to obtain the data you want.