客户端应用程序的 PHP REST API 授权 [英] PHP REST API Authorization for client applications

查看:29
本文介绍了客户端应用程序的 PHP REST API 授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
Restful API 认证推荐?

我正在用 PHP 编写 API,它选择使用尊重/REST.

I'm writing an API in PHP and it opted to use Respect/REST.

这不是一个公共 API,即只有经过授权的客户端应用程序才能在那里使用.这就是我想了解如何保证 API 处理的信息的安全性的地方.客户端应用程序可以用任何语言编写,但正如我所说,应该允许它们使用 API.

This is not a public API, ie, only authorized client applications can consume there. And this is where I would like some idea of how to guarantee the security of information that the API handles. The client applications can be written in any language, but as I said, they should be allowed to use the API.

目前我正在使用 jQuery.rest 为这个 API 编写一个测试客户端.

At the moment I'm writing a test client for this API using jQuery.rest.

我的疑问是:

1) 如何确保只有经过授权的客户端才能访问 API?

1) How to ensure that only authorized clients can access the API?

2) 如何确保对 API 的每个请求都得到了客户端的授权?

2) How to ensure that every request made to the API has been authorized client?

推荐答案

最常见的方法之一是使用 oauth,但这不是唯一的方法.

one of the most common approach its using oauth, but its not the only way.

尝试在 apigee 上查看资源,他们有关于 api 服务器和身份验证的有用的免费电子书和网络广播.

Try to look resources at apigee they have useful free ebooks and webcast about api servers and authentication.

第一个可能会解决你的疑惑,另一个只是为了了解更多关于服务器 API 的信息

The first maybe will cover your doubts, the other are just to learn a little more about server API's

还可以看看他们的视频网络广播

这篇关于客户端应用程序的 PHP REST API 授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆