Original address: http://blog.csdn.net/lhbeggar/article/details/46377653
How to ensure the security of the interface when PHP does the app interface?
1, when the user login to the app, using the HTTPS protocol to invoke the background related interface, the server based on the user name and password to generate a access_key, and save Access_key in session, will generate Access_key and session_ The ID is returned to the app side.
2, the app side will receive the Access_key and session_id saved up
3. When the app side calls the interface to transmit data, the transmitted data and the Access_key use the encryption algorithm to generate the signature signature, and send signature and session_id together to the server side.
4, the server to receive data, using session_id from the session to obtain the corresponding Access_key, Access_key and received data using the same encryption algorithm to generate corresponding signature, If the generated signature and the received signature are the same, the data is valid
PHP processing interface ensures data security