Just getting started building an app using the v6 of the facebook c# sdk and stuck on the login process for facebook. I have the following code in my page:
string client_id = ConfigurationManager.AppSettings["APIKey"].ToString();
string client_secret = ConfigurationManager.AppSettings["Secret"].ToString();
string redirect_uri = ConfigurationManager.AppSettings["Url"].ToString() + "default2.aspx";
FacebookClient objClient = new FacebookClient();
var fbLoginUrl = objClient.GetLoginUrl(new { client_id = client_id,
client_secret = client_secret,
redirect_uri = redirect_uri,
response_type = "code",
display = "popup",
scope = "manage_pages,publish_stream,read_stream",
state = "" });
//msg.Text = fbLoginUrl.ToString();
Response.Redirect(fbLoginUrl.ToString());
When I go to the page, the redirect to log in never happens. What am I doing wrong?
With MVC 3 (look at the published example), i make a view where the login starts. The controller is :
where returnUrl is the connected view area in my app (/home/fbhome) and RedirectUri is the view (loginresult) which will deals the second step :
So, as far as i understand, the user enter the site (/home/index) then click on a link to connect (/home/loggon), facebook answer to (/home/loginresult) and the user is redirected to /home/fbhome
Hope this helped
Sorry for my english !