Allow only PHP request from Android App

痴心易碎 提交于 2019-12-02 03:17:06

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!