dsh8009271 2014-08-19 12:45
浏览 46
已采纳

如何在iOS应用程序中验证用户并从Wordpress数据库获取数据?

I have Wordpress website where registered users can register for different events. Now I'm working on iPhone app. This app will allow users to do the same thing (register for events) but from iPhone. What I want to understand is what is better and more secure way to authenticate user from iPhone app? User will insert username and password in app, but how could I know is username and password correct or not? I know Wordpress has XML-RCP which maybe could help me achieve that, but people say its very slow. I found JSON API allows to retrieve and manipulate WordPress content using HTTP requests, but looks like there is nothing for user authentication, or maybe I'm wrong?

Any scenario or suggestions how to achieve this?

  • 写回答

1条回答 默认 最新

  • doulun1939 2014-08-19 13:24
    关注

    Are you asking a question about the JSON API, or are you looking for a general solution to this problem? Common practice when using a REST api is to sign requests with a private key, which you store in the app (for example in localStorage). The user would need to login once using the API, receive and store the privatekey, and apart from login requests the server only accepts signed requests. It is not 100% unhackable (what is?), but it's considered 'safe enough'.

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

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?