facebook-sdk icon indicating copy to clipboard operation
facebook-sdk copied to clipboard

Long-Lived User Tokens

Open bbelderbos opened this issue 8 years ago • 5 comments

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

bbelderbos avatar Jul 20 '16 23:07 bbelderbos

Me too!

bosihu avatar Jul 22 '16 08:07 bosihu

Will this be added at some point?

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

martey avatar Jul 23 '16 03:07 martey

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

kz26 avatar Jul 28 '16 20:07 kz26

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.

martey avatar Jul 28 '16 21:07 martey

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.

patil16nit avatar Apr 03 '17 16:04 patil16nit