如何在Apache Tomcat(Liferay)上添加Twitter对Opensocial的支持? [英] How to add Twitter support for Opensocial on a Apache Tomcat (Liferay)?

查看:160
本文介绍了如何在Apache Tomcat(Liferay)上添加Twitter对Opensocial的支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近升级到Liferay 6.1(主干从2011年11月17日开始使用b4)来测试Opensocial支持.现在,我想发出一个Twitter Oauth请求,但我无法执行此操作. 我首先测试了Opensocial是否可以与一些示例小工具一起使用,但是每个小工具都出现错误.

Error: 403 Error, OAuth error: NOT_OWNER, Non-Secure Owner Page. Only page owners can grant OAuth approval ==== Original request: GET /1/account/verify_credentials.json Host: api.twitter.com X-Shindig-AuthType: oauth X-Forwarded-For: 87.139.78.177 X-shindig-dos: on ====

我现在的想法是自己创建一个小工具,但是第一步是要我向"org.opensocial.client.OpenSocialProvider"类添加一个提供程序,我是从这里获得的. 所以现在的问题是,我不知道如何添加对Twitter的支持,我想我必须将其添加到WEB-INF/classes/com/liferay/opensocial目录中的某个位置,但是我不知道确切的位置.

这很重要,因为我想从一个小工具发出许多oauth请求,并且如果我必须添加另一个需要Oauth的功能,那么拥有一个可以提供所有Oauth呼叫的小工具会更容易.

一个如何添加提供者以及如何进行Oauth调用的示例非常棒,请提前感谢.

解决方案

将小工具添加到私有页面(例如我的私有页面").当前,您只能将OAuth小工具添加到您作为所有者的页面上,因此出现错误只有页面所有者可以授予OAuth批准".

这是出于安全目的从底层Shindig实施设计而来.

如果您还没有看到它,可以按照以下步骤在Liferay上添加OAuth小工具: Class, I got this from here. So the Problem now is that i dont know how to add the support for Twitter, i guess i have to add it somewhere in the WEB-INF/classes/com/liferay/opensocial directory, but i have no clue where exactly.

This is important because i wanted to make many oauth requests from one gadget and if i have to add another Feature which requiers Oauth it would be easier to have a gadget which provides all Oauth Calls.

A Example how to add a Provider and how to make the Oauth call would be awesome, thanks in advance.

解决方案

Add the gadget to a private page like "My Private Page". Currently you can only add OAuth gadgets to pages where you are the owner, hence the error "Only page owners can grant OAuth approval".

This is by design from the underly Shindig implementation for security purposes.

If you haven't seen it already, you can follow these steps to add OAuth gadgets on Liferay: link. It will show you how to add the consumer key/secret from a provider. It also references a sample Twitter gadget.

这篇关于如何在Apache Tomcat(Liferay)上添加Twitter对Opensocial的支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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