掲示板

How to change scope of permission in Facebook authorization?

11年前 に Marcin Sareło によって更新されました。

How to change scope of permission in Facebook authorization?

New Member 投稿: 21 参加年月日: 12/06/27 最新の投稿
Hi
How to change scope of permission in url when user is authorized?

I tried change permissions at developers.facebook.com but have no effect.
11年前 に Marcin Sareło によって更新されました。

RE: How to change scope of permission in Facebook authorization?

New Member 投稿: 21 参加年月日: 12/06/27 最新の投稿
Nobody don't know where i change url parameters?
11年前 に Peter Hellstrand によって更新されました。

RE: How to change scope of permission in Facebook authorization?

Regular Member 投稿: 166 参加年月日: 11/11/30 最新の投稿
Look in navigation.jsp

Create a hook and extend the scope.


<%
				String facebookAuthRedirectURL = FacebookConnectUtil.getRedirectURL(themeDisplay.getCompanyId());
				facebookAuthRedirectURL = HttpUtil.addParameter(facebookAuthRedirectURL, "redirect", HttpUtil.encodeURL(loginRedirectURL.toString()));

				String facebookAuthURL = FacebookConnectUtil.getAuthURL(themeDisplay.getCompanyId());
				facebookAuthURL = HttpUtil.addParameter(facebookAuthURL, "client_id", FacebookConnectUtil.getAppId(themeDisplay.getCompanyId()));
				facebookAuthURL = HttpUtil.addParameter(facebookAuthURL, "redirect_uri", facebookAuthRedirectURL);
				facebookAuthURL = HttpUtil.addParameter(facebookAuthURL, "scope", "email"); [b]//<---   Here[/b]

				String taglibOpenFacebookConnectLoginWindow = "javascript:var facebookConnectLoginWindow = window.open('" + facebookAuthURL.toString() + "','facebook', 'align=center,directories=no,height=560,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=1000'); void(''); facebookConnectLoginWindow.focus();";
				%>

11年前 に Marcin Sareło によって更新されました。

RE: How to change scope of permission in Facebook authorization?

New Member 投稿: 21 参加年月日: 12/06/27 最新の投稿
Thanks for replay!
Yes, I know, but I use Liferay 6.05. I edit FacebookConnectAction.java :

redirect = HttpUtil.addParameter(redirect, "scope", "email,user_about_me,publish_actions,publish_stream");


And still doesn't work.

In Liferay 6.1 login by Facebook doesn't work after simple configuration, but in 6.05 work without any problems.
11年前 に Peter Hellstrand によって更新されました。

RE: How to change scope of permission in Facebook authorization?

Regular Member 投稿: 166 参加年月日: 11/11/30 最新の投稿
OK

Works for me. I do this Liferay 6.1 in a post login hook. The url can be used to get user intererst with Spring RestTemplate for example.



HttpSession session = (request).getSession();
String token = (String) session.getAttribute("FACEBOOK_ACCESS_TOKEN");
String url = "https://graph.facebook.com/me/interests?access_token="+token;