如何使用Koala gem取消对用户Facebook权限的授权 [英] How to deauthorize User Facebook Permissions using Koala gem

查看:102
本文介绍了如何使用Koala gem取消对用户Facebook权限的授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Koala处理FB呼叫.一切工作正常,但我不知道如何取消对用户的FB权限的授权.

I am using Koala to handle FB calls. Everything is working fine except I can't figure out how to deauthorize a user's FB permissions.

等效的REST调用将是:

The equivalente REST call would be to:

DELETE /{user-id}/permissions/{permission-name}

Koala Wiki指示通过以下方式支持所有REST调用:

The Koala wiki indicates all REST calls are supported via:

@rest = Koala::Facebook::API.new(oauth_access_token)

@rest.fql_query(my_fql_query) # convenience method
@rest.fql_multiquery(fql_query_hash) # convenience method
@rest.rest_call("stream.publish", arguments_hash) # generic version

但这并不能告诉我很多.

but this doesn't tell me much.

我更喜欢使用Koala,因为我已启用了应用程序秘密安全性,并且为普通FB REST调用生成app_secret_proof是一个主要的麻烦.考拉透明地处理它.

I would prefer to use Koala as I have app secret security enabled and generating app_secret_proof for plain FB REST calls is a major hassle. Koala handles it transparently.

推荐答案

弄清楚了. 实例化@rest对象后:

Figured it out. After instantiating the @rest object:

@rest = Koala::Facebook::API.new(oauth_access_token, app_secret)

您可以通过以下方式查看其方法:

you can check out its methods via:

@rest.methods

,您会注意到它返回了 RESTful 方法,例如#get_object#put object和我们的赢家:#delete_object. 然后,这只是一个问题:

and you'll notice it returns RESTful methods like #get_object, #put object, and our winner: #delete_object. Then it's just a matter of doing:

@rest.delete_object("me/permissions")

成功!

这篇关于如何使用Koala gem取消对用户Facebook权限的授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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