Using facebook oauth 2.0 - How do I fetch the access token

Posted by Chris Sunderland on Stack Overflow See other posts from Stack Overflow or by Chris Sunderland
Published on 2010-06-07T09:15:11Z Indexed on 2010/06/11 23:23 UTC
Read the original article Hit count: 904

Filed under:
|
|

Hi all!

I am new to oauth and I'm trying to use facebook connect with my web-application.

I have succeded in getting a verification token but my problem is "fetching" the access token. How do I fetch it? Facebook documentation tells me to fetch the access token with this URL:

https://graph.facebook.com/oauth/access_token?'
                + 'client_id=XXXXXXXXXXXX& redirect_uri=http://www.mysite.com/fbconn/index.html&display=touch&'
                + 'client_secret=axxxxxcxxxxxxxxxxx&code=' + code;

When I use this I see the access token on a blank page, but I want to fetch it with javascript (AJAX) /PHP or something. Is this possible? I thought the access token would be appended to my redirect uri like the verfication code but I never get redirected to my page. What am I doing wrong?

Grateful for help/comments

/Chris

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about facebook