0

I have a rails application which can post embeds of public facebook videos. In order to properly credit the videos i retrieve video owner via a graph api call like

https://graph.facebook.com/{video_id}?access_token={facebook_user_access_token}

which works fine. The issue is with oauth and long-term tokens. I know I can exchange a short term token for a 60 day token,

https://graph.facebook.com/oauth/access_token?  
    grant_type=fb_exchange_token&           
    client_id={app-id}&
    client_secret={app-secret}&
    fb_exchange_token={short-lived-token}

but the issue is generating the short term token. Is there a way to generate a short term token just on the server-side via the api. I will only ever want to oauth one user in order to access the graph api. But all the oauth flows require a facebook dialog login, which won't support me just on the server side. At this stage I am thinking of simply updating the token manually every 60 days so any ideas or help is welcome.

4

1 回答 1

0

你有没有想过使用考拉宝石

还有另一个 SO 线程 - Renew Facebook access token with Koala解释了如何使用 koala 生成短期令牌

于 2013-10-31T18:44:41.953 回答