Allow only PHP request from Android App

前端 未结 2 1324
无人及你
无人及你 2021-01-24 00:32

I have some PHP pages that receive POST requests and make CRUD operations in my MySQL database...

I would like to know if there is a way to allow only my Android applica

相关标签:
2条回答
  • 2021-01-24 01:07

    I would store a secret key in your app and send that along with the request to log the user in. This secret key would be stored on the server and compared at login. If the key matches and user is authenticated then log user in.

    0 讨论(0)
  • 2021-01-24 01:16

    I would like to know if there is a way to allow only my Android application to do those requests in my pages...

    This is an impossible request.

    You cannot guarantee that end users are using your application to send data to your server over a public network (i.e. the Internet). Full stop, not gonna happen.

    What you should do instead is ensure your server-side code is written to where, regardless of what data is hurled at it, your server doesn't get hacked.

    0 讨论(0)
提交回复
热议问题