How to ensure access to my web service from my code only?

前端 未结 9 1922
天命终不由人
天命终不由人 2020-12-17 22:32

I am writing a very simple web service for my iPhone app. Let\'s say this is a http page that returns a random number at http://mysite/getRand. How do I ensure that this pag

9条回答
  •  眼角桃花
    2020-12-17 22:55

    I would use the https protocol with client-side keys too. You can use one client key for everyone or you can even generate a different key for each client and "register" them at your server.

    I suppose that it's a lot of work for small project, but it sounds like the appropriate thing to do if you need authentication.

    You should check that keys aren't seen easily by mobile phone owner. And remember that somebody will be able to hack it in any case.

提交回复
热议问题