Facebook c# sdk Fork: Version5 oAuth
First, please excuse me because i speak english like a french cow!
This is it, i have decided to get off the Facebook Toolkit and start to use the Facebook c# sdk.
I looked at the v4.2.1. Then i read "http://facebooksdk.codeplex.com/Thread/View.aspx?ThreadId=241181" and i downloaded the v5 source code.
I've got a little problem with the auth process with this V5. Here is my code:
string _requiredAppPermissions = "offline_access,email";
FacebookApp fbApp = new FacebookApp();
var fbSettings = new FacebookSettings();
fbSettings.AppId = RWE.Core.Config.FacebookApp;
fbSettings.AppSecret = RWE.Core.Config.FacebookSecret;
Authorizer authorizer = new Authorizer(fbSettings);
//Authorizer authorizer = new Authorizer();
if (!String.IsNullOrEmpty(_requiredAppPermissions)) authorizer.Perms = _requiredAppPermissions;
authorizer.Perms = _requiredAppPermissions;
authorizer.ReturnUrlPath = _AuthUrlReturn;
authorizer.Authorize();
var me = fbApp.Api("me");
So if i load the app from the url : "http://apps.facebook.com/myapp", it displays a facebook logo with (in french) "Accéder à Facebook" (which means 'access to facebook'). The link is kind of "http://www.facebook.com/connect/uiserver.php?app_id=170580299646394&method=per开发者_如何学Pythonmissions.request&display=page&next=http%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html&response_type=code&fbconnect=1&perms=offline_access%2Cemail" If i load the app from "http://realurl.com", it displays directly the authorisation form like it should be in the facebookapp url.
My questions are :
How can i have the auth form displayed directly (without the facebook logo step) ?
While i specify a ReturnUrlPath, facebook still uses facebook.com/connect/login_success.html and leads me to facebook.com instead of going back to the app. How can i change that ?
Make sure you specify target="_top" for your <a> tag.
<a href="..." target="_top" />
精彩评论