留言板

Facebook Connect broken in Liferay 6.2

thumbnail
Johannes Feulner,修改在7 年前。

Facebook Connect broken in Liferay 6.2

New Member 帖子: 4 加入日期: 16-7-5 最近的帖子
Facebook Connect does not work anymore on our website www.scorio.com since March 26 2017

Facebook Connect is completely broken.

On this day Facebook killed version 2.2 of its Graph API and updated 2.2 apps to 2.3

However, 2.3 changed in an incompatible way. On https://developers.facebook.com/docs/apps/changelog Facebook writes:

[Oauth Access Token] Format - The response format of https://www.facebook.com/v2.3/oauth/access_token returned when you exchange a code for an access_token now return valid JSON instead of being URL encoded. The new format of this response is {"access_token": {TOKEN}, "token_type":{TYPE}, "expires_in":{TIME}}. We made this update to be compliant with section 5.1 of RFC 6749.


This means, that the implementatino of FacebookConnectImpl.java is now broken and will not work anymore.

Anyone knows about an Update/Workaround/Quick Fix for Liferay 6.2?

Update:
Problem solved, Facbook Connect up and running again. Since the root cause will not get fixed in short time, I built a Liferay -> Facebook proxy. This proxy has been successfully tested on our site. It seems to work now, but will it last? Facebook leaps, Liferay creeps.

In case you have run into the very same problem, feel free to put my solution to test:

In the Facebook settings of your Portal set OAuth Token URL to http://www.scorio.com/scorio-facebookProxy/oauth/access_token
(yes, "http" indeed) and things should work again for you.

If after successful tests you want to install the solution at your site: Please contact me via e-mail: johannes.feulner@scorio.com
Jason Miller,修改在6 年前。

RE: Facebook Connect broken in Liferay 6.2

Junior Member 帖子: 25 加入日期: 16-7-11 最近的帖子
Does this fix still work? I tried it with a facebook test user, but it failed with the same message.
Odysseas Doumas,修改在6 年前。

RE: Facebook Connect broken in Liferay 6.2

New Member 帖子: 17 加入日期: 16-6-22 最近的帖子
Hello. There is another, pretty simple fix for the facebook connect problem in Liferay 6.2.
  • Create an EXT-Plugin
  • Inside the *-ext-impl folder, create a new package with name com.liferay.portal.facebook
  • Inside the new package create a FacebookConnectImpl.java class and copy the source code
  • Replace the code between lines 77 - 87, inside the
    if (Validator.isNotNull(content))
    block with the appropriate code to retrieve the facebook access token. It should be somenthing like
    JSONFactoryUtil.createJSONObject(content).getString("access_token")
  • Build and deploy your ext plugin


You should also delete most of the other folders created (especially the docroot/WEB-INF/ext-web/docroot/WEB-INF files). If you have another EXT plugin problems will arise if both plugins reference the same files. I may upload a fix later this day or week.
Roland Pogonyi,修改在6 年前。

RE: Facebook Connect broken in Liferay 6.2

New Member 帖子: 4 加入日期: 14-11-5 最近的帖子
I can't thank you enough for this. I've been stuck on it for days. I'm using your url and it's working fine.