Get access token to facebook page - WPF

前端 未结 2 1035
南笙
南笙 2021-01-03 13:44

I am developing a WPF application that needs post on wall of a facebook\'s Page, and this without login window. Well, I want to get access token for my facebook page, and th

2条回答
  •  醉酒成梦
    2021-01-03 14:16

    I'm not sure if you've been able to get a never expiring token for the page, so I'll explain you the steps:

    1. Open Graph API Explorer

    2. Select your app from the drop-down

      enter image description here

    3. Click "Get Access Token" button, and select the manage_pages permission.

    4. Copy the token and run this in the browser:

       https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={step-3-token}
      
    5. Copy the token from step-4 and paste in to the access_token field and call:

       /{page-id}?fields=access_token
      
    6. The token you get now is a never-expiring token, you can validate the same in Debugger .Use this in your app.

    But beware, its not recommended to use this token on client side if your app is public.

提交回复
热议问题