trying to get app access token

前端 未结 5 1425
感动是毒
感动是毒 2020-11-28 04:55

I tried to get an app-access-token for my facebook app with this code:

APP_ACCESS_TOKEN = FB.api(
    \"oauth/access_token\",
    {client_id: APP_ID, client_         


        
5条回答
  •  -上瘾入骨i
    2020-11-28 05:25

    https://developers.facebook.com/docs/howtos/login/login-as-app/:

    “Because it requires you to include your App Secret you should not attempt to make this call client-side as that would expose this secret to all your app users. It is important that your App Secret is never shared with anyone. For this reason, this call should be performed server-side”

    And for the app access token, it’s the same – you should never use it client-side, because every user could spot it there and then start using it to perform actions on behalf of your app (or change many of your app’s settings).

    If you have a server-side part to your application, you can simply “build” the app access token there yourself, concatenating app id and secret with a pipe symbol, app_id|app_secret.

提交回复
热议问题