Reputation: 6532
I implement some facebook related stuff and accessing graph api for that pourposes. But for implement Integration testing I need a simple strategy to get access_token
. So I create test user for that. How could I get access_token
only with server side involved, without including browser in the chain. Ideally I just need to exchange login/password to the token.
Correct workflow loooks like this:
According the correct answer, there is special tests users provided by facebook. To to be able to tests system properly you need to do the following flow
"GET /{app_id}/accounts/test-users"
Upvotes: 0
Views: 325
Reputation: 31489
You can't exchange the login/password for an Access Token, but you can create test users programmatically. Have a look here:
Upvotes: 1
Reputation: 74014
Short answer: You can´t.
Server side you can only get an App Access Token, Page Access Token or extend an existing Access Token.
So it depends on what you need to achieve, if you just want to get public stuff from a Facebook Page, even an App Access Token may be good enough. But you cannot create User Access Tokens server side.
It may be possible with real test users created via the Graph API itself though, see Tobis answer for links about that. But it is definitely not possible with username/password.
Upvotes: 1