From the introduction above, each time the user sends an HTTP request, a typical interaction is as follows: Take the JSON data format as an example
Request:
{ "Command": "Getorderlist", "Accesstoken": "3bf63b28-bdd2-4bb1-80b0-8d5b42070222"}
Response:
{"Success": true, "orderlist": [{"NO": "20150327131072", "Ordertime": "2015-03-27 09 : 33:20 "," TotalCost ": 118," Detail ": [{" Product ": { "GUID": "4bb603b2-0916-412d-ae51-b296c838673b", "Name": "Vegetable pot Stall", " Mainpicture ":" 5 (8). JPG "}," Count ": 1," Price ": 28}, {"GUID": "630e38dd-60ae-4ed0-98f0-affea23c5fee", "Product": { "GUID": "da9dce4a-101e-45dc-a88e-3b5e296ca092", "Name": "Fragrant pot Trotters", "mainpictu Re ":" 2 (1). JPG "}," Count ": 1," Price ": 58}, {"GUID": "6018c248-64e2-4185-98db-c1408aa0d482", "Product": { "GUID": "A405B104-F0EB-488C-AC41-A8A3DE2F0BCA", "Name": "Farmhouse crisp broth", "M Ainpicture ":" 7 (10). JPG "}," Count ": 1," Price ": 32}] }, {"NO": "20150325131079", "Ordertime": "2015-03-25 17:38:15", "TotalCost": "Status": 2, "Detail": [{"GUID": "77df4888-8c88-4c51-b669-74 71a8ae975b "," Product ": {" GUID ":" da9dce4a-101e-45dc-a88e-3b5e296ca092 ", "Name": "Fragrant pot Trotters", "Mainpicture": "2 (1). JPG "}," Count ": 1," Price ": 58}] } ]}You can see that the user obtains his own order, provides an access token, returns the user's order, and shows the effect here.
From the above communication process can be seen, are transmitted by the plaintext in the network, and the user orders so sensitive data, it is inappropriate. Once in transit, this access token is intercepted, the consequences are unimaginable, that is, we have to find ways to ensure the security of the transmission process.
At the thought of security in transit, we thought about HTTPS and encrypted all the data transmitted. HTTPS can undoubtedly solve this problem, it is designed to ensure the security of the transmission process.
is HTTPS the best solution when we don't need to do the same level of security as the bank? I don't think so, you can look down and then provide a way of thinking.
Refer to QQ Mailbox practices: QQ Mailbox Landing Page
To avoid a logical omission, a new problem has been introduced unknowingly: when requesting a list of orders from the server, We only provide a url: http://aa.com.cn/orders during the request? Accesstoken= 3bf63b28-bdd2-4bb1-80b0-8d5b42070222
If the user this URL is compromised, does it mean that the data we return to the user has been exposed (although AES encryption), since the user did not exit the system , anyone can get to the data by requesting this URL!!!
The data currently in the user's hand is: Key,accesstoken, the person who intercepts the URL already knows Accesstoken, the only thing that does not know is Key.
Here I give the idea from the signature, how to use this interceptor does not know the key to protect the user's URL, mainly refer to the payment method of generating payment links , the general idea is: