开发者

Facebook access token problem

I am connecting to login facebook page through an url. I receive the access token in my application and i can prints all my contacts from the list. I have a problem: there are times when i do receive the access token and if i logout from facebook and rebuild my application the second time , i don't have any access token. WHY? If i wait i guess 10-15 minutes and try again it works. How to resolve this? THX

I am using the auth url. THe following link was my example link: http://geekdeck.com/vb-net-facebook-get-access-token-for-desktop-application/

EDIT:

I have the following code:

browserFacebook.Navigate(@"https://graph.facebook.com/oauth/authorize?client_id="+ FacebookApplicationID + "&redirect_uri=http://www.facebook.com/connect/login_success.html&type=user_agent&display=popup");

 string someString = browserFacebook.Url.ToString();

This returns something like the following:

"http://www.facebook.com/connect/login_success.html#access_token=ACCESS TOKEN.expires_in=0"

I can then easily use this access token with the Graph API to access an users facebook details as in the following code:

Facebook.FacebookGraphAPI g = new FacebookGraphAPI("ACCESS_T开发者_如何学运维OKEN");
    var fbUser = g.GetObject("me", null);

PROBLEM:

When I rebuild the application, the link that i receive is OpenDNS (or navigation to the webpage was canceled) and I have to access token. Why? How can I resolve this error? After a a while 1-2 hours I receive again the token.


"https://graph.facebook.com/oauth/authorize?client_id=" + 
  FacebookApplicationID +  
  "&redirect_uri=http://www.facebook.com/connect/login_success.html&type=user_agent&display=popup");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜