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'.

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

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度