mobolic / facebook-sdk

Python SDK for Facebook's Graph API
https://facebook-sdk.readthedocs.io/
Apache License 2.0
2.75k stars 951 forks source link

Long-Lived User Tokens #300

Open bbelderbos opened 8 years ago

bbelderbos commented 8 years ago

Hello,

There is a way to extend a token, but I don't see this in the API:

"Generating Long-Lived User Tokens from Server-Side Long-Lived Tokens"

( https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension )

Will this be added at some point?

I need this for a command line script I am developing.

Thanks, Bob

bosihu commented 8 years ago

Me too!

martey commented 8 years ago

Will this be added at some point?

Like many open source projects, new features are generally added when someone contributes code implementing them.

kz26 commented 8 years ago

This is already implemented, actually: https://github.com/mobolic/facebook-sdk/blob/master/facebook/__init__.py#L317

martey commented 8 years ago

I believe @bbelderbos meant https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension#long-via-code, which is not implemented by extend_access_token.

patil16nit commented 7 years ago

It requires user interaction for generating user token with valid code return from Graph API which is then used to get long app access token (long lived token) used for getting the data from Graph API. Simply, Add some test users to FB app. Design simple UI to call the graph api for long token generation verify it using access token debug, which is portable token. Finally, use it in different scripts.