douzhantao2857 2015-11-24 08:55
浏览 44
已采纳

保护移动应用的服务器端页面[关闭]

I am building a mobile app that needs server side processing. I have created the server side using LAMP and the app just calls the respective php pages using an URL to request data. For example for signup I have created signup.php and app calls signup.php to verify login credentials of the app. I also have php scripts to say pull product information for the product the user is requesting. At this time these PHP pages are publicly accessible even though they would return a blank page. However how do I ensure these PHP pages are only accessible to my mobile application? How do I make it more secure?

Additionally the user on the mobile only needs to sign up once. Once signed up he stays logged in perennially until he uninstalls the app.

  • 写回答

1条回答 默认 最新

  • doupo5861 2015-11-24 09:16
    关注

    What you could do, is to have per device authentication. When your user goes to sign up in the app, app sends request to the server with credentials. If the credentials are OK you generate a unique hash. You store this hash close to the user - either directly to users table, or to a table that is in relation (depends if you allow multiple devices signed to one user). This hash will be send with every request to the server. Based on the hash you look-up the user and you know who you're dealing with.

    This hash can be, once in a while, regenerated (you send new hash to the device and that stores it again).

    Also, you can use some secrete key to create a checksum for every request. Than you create checksum on server as well and compare. Be aware though that, if the key is stored in the code, anyone can get it. This key can be sent from the server as well.

    It's probably obvious that the server should be on HTTPS.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题