在 PHP 服务器上从 iPhone 应用程序进行用户身份验证的良好解决方案
我一直在尝试为 iPhone 应用程序实现安全的用户身份验证。我几乎是一个新手。我看到了许多代码片段和不同方式的建议,有些似乎已经过时了。在目前的情况下,什么是一个好的选择? JSON? ASIHTTP 请求?
到目前为止,我还没有找到合适的解决方案。我发现整合不同的想法并提出适合我的需求的解决方案有点困难。如果有人可以分享示例代码或至少向我指出在某处发布的解决方案,那就太好了。提前致谢。
托尼
I have been trying to implement a secure user authentication for an iPhone app. I am pretty much a newbie. I saw many code snippets and suggestions for different ways, and some seemed out dated. In the present scenario, what would be a good option? JSON? ASIHTTPRequest?
Till now, I couldn't find a proper solution for this. I am finding a bit difficult to integrate different ideas and come up with a solution to suit my need. Would be great if someone could share a sample code or at least point me to a solution posted somewhere. Thanks in advance.
Tony
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用它成功地通过 iOS 应用程序对远程 PHP 服务器进行了用户身份验证。有点晚了,但它可能对某人有帮助:
I used this to successfully authenticate a user with a remote PHP server from an iOS app. A bit late, but it may help someone:
您的服务器有什么类型的用户身份验证?您可以使用基本身份验证进行身份验证,这几乎意味着发送
Authorization<每个请求的 /code>
标头。
ASIHTTPRequest 具有启用基本身份验证的功能,甚至可以显示登录对话框(如果您是)可以使用它(该项目刚刚停止)。
您显然需要 也在您的服务器上实现基本身份验证。
What kind of user authentication does your server have? You could use Basic Auth for authentication, which pretty much means sending the
Authorization
headers with every request.ASIHTTPRequest has functionality enabling basic auth and even presenting a login dialog, if you're OK with using that (the project's just been discontinued).
You would obviously need to implement basic authentication on your server as well.