Search code examples
facebook-graph-apifacebookfacebook-java-apifacebook-java-sdk

How can i get access_token and then use it?


In my web application i want users to login with their facebook account. I am doing it by redirecting url.

 response.sendRedirect("http://www.facebook.com/dialog/oauth/?scope=email,user_about_me&dispplay=popup&client_id={app_id}&redirect_uri=http://example.com/index.jsp&response_type=token");

At index.jsp i am getting access_token in url. But in request there is no access token. how can i get access token here and then fetch user email. url at index.jsp looks like this:

  http://example.com/index.jsp#access_token={access_token}

Thanks in advance.


Solution

  • I found a tutorial and it solved my problem. Following is the link of that turorial:

    http://pinoyphp.blogspot.com/2010/12/oath-tutorial-how-to-get-facebook.html#comment-form