Search code examples
facebookfacebook-graph-apifacebook-appsaccess-token

How to get Facebook access token with username / password


Using Facebook graph API I can get the fb access token. And to do so I have to visit the facebook.com to allow the application to access my data through the Login dialog.

Is there any way to get the Facebook access token, by using account id and password, from API, without visiting facebook.com / without any application ?


Solution

  • User access token:

    If you want to get user access token then the answer is NO. You cannot access user access token without making the user visit facebook.

    Do some reading on OAuth and understand what is its concept

    App access token:

    If you mean application access token then you can make a curl call to facebook. See here for details

    Facebook's access token documentation explains the different types of Access tokens and how to obtain and use them - all user access tokens will require direct interaction from a user though