How can I get a new “authorization code” without HTTP redirection?

In this URL , Facebook explains how to authenticate using Facebook Connect.

Basically, the following steps:

  • Redirecting to facebook as an example. As a result, I will receive an authorization code

    https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=email,read_stream
    
  • Send an HTTP message to the following address by asking for access_token

    https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&client_secret=YOUR_APP_SECRET&code=THE_CODE_FROM_ABOVE
    

Facebook will respond to the last HTTP post with access_token . Good.


The validity of the access_token obtained above. The number of seconds during which it will still be valid is returned with access_token . OK.

Problem: What to do after it expires?

- Facebook:

( access_token) ( expires). , , access_token

! , (1). . -. , .

?

PS: , access_token. access_token. , , facebook , .

+5
2

offline_access, Facebook .

:

https://graph.facebook.com/oauth/access_token?             
    client_id=APP_ID&
    client_secret=APP_SECRET&
    grant_type=fb_exchange_token&
    fb_exchange_token=EXISTING_ACCESS_TOKEN 

, ,

Currently the long-lived user access_token will be valid for 60 days while the 
short-lived user access_tokens are currently valid from 1 to 2 hours.

. https://developers.facebook.com/roadmap/offline-access-removal/

0

All Articles