How to get ACCESS_TOKEN automatically

477 views
Skip to first unread message

István Farkas

unread,
Feb 23, 2013, 4:05:40 PM2/23/13
to res...@googlegroups.com
Hi everyone!

Could somebody help me with one question?

ant run-reader-examples "-Daccess_token=MY_ACCESS_TOKEN"

works fine, but how can I automatize the following steps?

    Request https://graph.facebook.com/oauth/authorize?client_id=MY_API_KEY& redirect_uri=http://www.facebook.com/connect/login_success.html& scope=publish_stream,create_event
    Facebook will redirect you to http://www.facebook.com/connect/login_success.html? code=MY_VERIFICATION_CODE
    Request https://graph.facebook.com/oauth/access_token?client_id=MY_API_KEY& redirect_uri=http://www.facebook.com/connect/login_success.html& client_secret=MY_APP_SECRET&code=MY_VERIFICATION_CODE
    Facebook will respond with access_token=MY_ACCESS_TOKEN

I always copy those 2 URI-s into my browser to get MY_ACCESS_TOKEN but I wonder if there is a solution to automatize these steps right before I post some stuff on Facebook.
The best solution for me would be a servlet to do that.

Thanks for your help!

Marcel Stör

unread,
Feb 24, 2013, 2:41:32 PM2/24/13
to res...@googlegroups.com
https://developers.facebook.com/docs/concepts/login/ doesn't answer
these questions for you?
I'm sure everyone around here has different preferences and you'll find
tons of solutions on Google or Stackoverflow e.g. this one:
http://hello-its-crazy.blogspot.ch/2012/05/getting-facebook-accesstoken-using.html

Cheers,
Marcel

--
Marcel St�r, http://www.frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Kobus du Toit

unread,
Feb 24, 2013, 3:02:42 PM2/24/13
to res...@googlegroups.com

Rana Ashraf

unread,
Jan 27, 2014, 11:15:19 PM1/27/14
to res...@googlegroups.com
{
   "error": {
      "message": "Error validating application. Cannot get application info due to a system error.",
      "type": "OAuthException",
      "code": 101
   }
}
Could any one help me why this error appears and what should I do to get the ACCESS_TOKEN of my app ??
Reply all
Reply to author
Forward
0 new messages