如何验证用户生成的“应用程序”?为您的应用程序?
我想这里有类似 Facebook 应用程序的东西。用户生成的代码片段,人们可以编写这些代码片段来与我的应用程序交互。
我了解经过身份验证的 API 的工作原理,但这似乎有点复杂,因为应用程序不仅必须对自身进行身份验证(使用常规 api 密钥),而且使用该应用程序的用户也必须以某种方式进行身份验证,而无需向应用程序提供任何信息自由统治。
我在这里阅读了一些内容,看看 FB 是如何做到这一点的: http://wiki .developers.facebook.com/index.php/How_Facebook_Authenticates_Your_Application
看起来除了 api 密钥之外,您还必须在每次调用时传递签名,但我无法理解这是如何实现的在另一端(我的服务器)生成并使用。
应该有一个简单的解释吗?谢谢!
PS如果有任何适用的gems/插件,我正在构建一个Rails应用程序。
I'm think something like Facebook apps here. User generated pieces of code that people can write to interact with my app.
I understand how an authenticated API works, but this seems a little more complicated because not only does the APP have to authenticate itself (with a regular api-key) but the USER using the app has to be authenticated somehow too, without giving the app free reign.
I've been reading a bit here to see how FB does it: http://wiki.developers.facebook.com/index.php/How_Facebook_Authenticates_Your_Application
And it looks like you have to pass a signature in addition to the api-key along with every call, but I'm having trouble wrapping my head around how this gets generated and used on the other end (my server).
Figure there must be a simple explanation of this out there? Thanks!
P.S. I'm building a Rails app if there are any applicable gems/plugins.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能是我需要的:
http://github.com/phurni/authlogic_api
This may be what I need:
http://github.com/phurni/authlogic_api
您在 authlogic_api 方面取得了成功吗?我正在开发 Steam 游戏的服务器端,用户通过 Steam 登录,因此我只响应来自客户端的 REST 调用(不需要用户登录)。 authlogic_api 的 rdocs 提供了一些简短的设置信息,但我正在努力解决在 application_controller 中做什么来限制访问;本质上相当于 authlogic 示例中的代码:
http://github.com/binarylogic/authlogic_example/blob/5819a13477797d758cb6871f475ed1c54bf8a3a7/app/controllers/application_controller.rb
Did you have any success with authlogic_api? I'm working on the server-side for a Steam game, where users are logged in through Steam, so I'm only responding to REST calls from the client (no user login required). The rdocs for authlogic_api give some brief set-up info, but I'm struggling with what to do in the application_controller to restrict access; essentially the equivalent of this code from the authlogic example:
http://github.com/binarylogic/authlogic_example/blob/5819a13477797d758cb6871f475ed1c54bf8a3a7/app/controllers/application_controller.rb