[ My humble request: please don't ignore this question just by adding some reference question link. I read all the reference i can, but i didnt get what i need]
I am trying to make a windows/console application where i need to access the user details offline. So i tried the following code.
String finalRedirectUri = "https://www.facebook.com/dialog/oauth?client_id=" +
_appKey2 + "&redirect_uri=" + _SiteURL + "&scope=email,read_stream";
String GraphUri = "https://graph.facebook.com/oauth/access_token?client_id=" +
_appKey2 + "&redirect_uri=" + _SiteURL + "&scope=email,read_stream";
FacebookClient client = new FacebookClient(_appKey2, _secret2);
FacebookOAuthClient oAuthClient =
new FacebookOAuthClient(FacebookApplication.Current);
oAuthClient.AppId = _appKey2;
oAuthClient.AppSecret = _secret2;
oAuthClient.RedirectUri = new Uri(finalRedirectUri);
String Uri = oAuthClient.GetLoginUrl().ToString();
try
{
dynamic tokenResult =
oAuthClient.ExchangeCodeForAccessToken("offline_access");
}
catch (Exception exp)
{
MessageBox.Show("" + exp.Message);
}
I am always getting error message: " (OAuthException) Invalid verification code format" I searched many links in stackoverflow and http://developers.facebook.com/docs/authentication/ also but it didnt helped me to find the solution. I dont even know which uri to use. I am using Visual Studio 2010 [ Please donot simply ignore this question just by marking as duplicate] Be gentle to me please..