Get access token with appid and userid - facebook

I have a facebook app. id and a facebook user id, I need to retrieve the access token for such a user. How could I do that?
Cheers.

It is not possible to generate a user access token using simply an application id and secret you must go through a login flow.
https://developers.facebook.com/docs/facebook-login/

Related

How to model Facebook access tokens and user accounts

I'm building an app that allows users to sign up with facebook login. Facebook login gives us an expiring access token.
So far I've thought through having the phone app collect the facebook access token itself and it should POST it to the api. The api can search to see if it's seen this token before and if it hasn't the api should generate a new user account.
However the facebook docs mention that this token expires. If a user's token expires and they provide a new token to my api, the api will generate a new account for the existing user. How should I solve this?
Use the access token to access https://graph.facebook.com/me?fields=id, which will give you the user's unique ID for your application. Use that as the primary key.
You can try this out with the graph explorer tool https://developers.facebook.com/tools/explorer/
You'll get a response like
{
"id": "10123455041265200"
}
Docs https://developers.facebook.com/docs/graph-api/reference/user/

Get facebook page id from page access token

I am working on a application where i am asking for appid, secret and page access token from user. I do not want to ask Page Id. so how can i get Page Id from page_access_token.?
I do not want to ask Page Id. so how can i get Page Id from page_access_token?
You can either debug the access token via an API call - but that would require that the token was issued for your app.
Or you simply make an API call for /me using the page access token - that will return the page id.

Fecebook access token Storage For ouath implementation

I am using facebook login in my iphone app and am accessed some basic details from Facebook API such as name, dob, email , username for user creation. I want to store access token for each user . Need your help in this
You can extend the duration of the access token
https://developers.facebook.com/docs/howtos/login/extending-tokens/

Do you need a User Access token to access the facebook graph people search?

Is it possible to do it with an App access token? I want to make an app that has a lot to do with anonymity so I don't want to have to run the user through facebook login if I don't have to. Is a user access token the only way?
It used to be possible to do a search with no token, but it seems like you now have to use a user token. I've tried with an app access token and it just returns an error saying a user access token is needed.

Get Facebook Users Access Token

Is it possible to get the access Token of a user with his FacebookId, Application Id and Application secret ?
PS : The user has already accepted to use the app.
Thanks
You can get the access_token of the user at the time he adds the app, or when he login again using the app. Not at a later moment than that.
You can use an app access_token which doesnt expire and is valid from the point the user adds your app. But keep in mind, it has limited retrieval capabilities comparing a user access_token.