As per your code for get access token i do it
but i get the this error "The remote server returned an error: (400) Bad Request."
My code is below
private static string WebResponseGet(string url)
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
using (StreamReader reader = new StreamReader(webRequest.GetResponse().GetResponseStream()))
{
return reader.ReadToEnd();
}
}
private void GetToken(string userId)
{
string accessToken = WebResponseGet(string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&client_secret={2}&code={3}", "134941433319444", "http://localhost:1072/DMS_HelpLine", "be06862cbacb4f84f5112ebcc4bc3b2c", ViewState["Code"].ToString()));
}
I get the error like
{
"error": {
"message": "Error validating verification code.",
"type": "OAuthException",
"code": 100
}
}
and here also i attach screen shot for facebook graph api details
I put the same redirect uri as i write in facebook api
also one confution : why pass userid in GetToken() function , there is no use of it in GetToken() functon
