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

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

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵