简体   繁体   English

CakePHP-REST API-API ID /秘密身份验证

[英]CakePHP - REST API - Api id/secret authentication

We have a large high traffic site with a lot of data on it (similar to Kickstarter), and we want to provide to our content/project creators a means of pulling their data from our site via an API. 我们有一个大型的高流量站点,上面有很多数据(类似于Kickstarter),并且我们想为我们的内容/项目创建者提供一种通过API从我们的站点中提取数据的方法。

Someone suggested I use OAuth, however my experience with OAuth is limited to setting up a twitter datasource. 有人建议我使用OAuth,但是我对OAuth的经验仅限于设置Twitter数据源。

What I want to do 我想做的事

  • Provide a user an Application ID and a 'secret' 向用户提供应用程序ID和“秘密”
  • Allow this user to connect to our application via an api endpoint, authorizing themselves using the api ID and secret 允许该用户通过api端点连接到我们的应用程序,并使用api ID和密码授权自己
  • Once verified, allow this user to pull only their data from the application 验证后,请允许该用户仅从应用程序中提取其数据
  • The data that a user can pull: votes they have cast, pledges they have made, purchases they have made, projects/ideas they have launched, data about those projects/ideas (votes/purchases/orders/cancellations etc) 用户可以提取的数据:他们的投票,所作的承诺,所做的购买,发起的项目/想法,有关这些项目/想法的数据(投票/购买/订单/取消等)

My question is: 我的问题是:

Is OAuth overkill? OAuth会大材小用吗?

Is there a better way to handle a user/users website to connect to our API and pull/verify certain data by using the API we make available, while requiring each incoming request to be authorized for the user/site initiating that request. 有没有更好的方法来处理用户网站,以使用我们提供的API连接到我们的API并提取/验证某些数据,同时要求每个传入请求都被授权给发起该请求的用户/站点。

Ideally, we will have an endpoint that is accessed as: 理想情况下,我们将有一个通过以下方式访问的端点:

https://api.oursite.com/request/params

We want this to be as simple as possible for our users that wish to implement this interface. 对于希望实现此接口的用户,我们希望它尽可能简单。 Thanks for your help! 谢谢你的帮助!

Generally it's OAuth, in combination with SSL. 通常,它是OAuth,与SSL结合使用。 That's the standard and is likely to stay. 这是标准,很可能会持续下去。 Before we saw also logins: username + password to access an API but that's becoming less and less. 在我们还看到登录信息之前:用户名+密码以访问API,但是这种登录越来越少了。

So the suggested way is OAuth. 因此建议的方法是OAuth。 There are no serious other solutions yet. 尚无其他严肃的解决方案。 To make it easier to adopt your API you could release some classes in some development languages so developers can have a quick start. 为了使采用API更加容易,您可以使用某些开发语言发布一些类,以便开发人员可以快速入门。 You could start releasing those classes at for example GitHub to raise adoption of your API and get a quick access to developers. 您可以在例如GitHub上开始发布这些类,以提高您的API的采用率并快速访问开发人员。 They might, if you do well, even start improving it. 如果您做得好,他们甚至可能会开始改进它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM