According to the documentation the endpoint looks like
GET /debug_token?
input_token={input-token}&
access_token={access-token}
where
input_token:
the access token you want to get information about
access_token
: your app access token or a valid user access token from a developer of the app
Assuming I don't have a "valid user access token from a developer of the app" - just because I don't want to refresh it every 2 months and keep always it in mind - how would I perform it using "app access token"?
The getApplicationAccessToken()
method is protected, so there is no way to access it without overriding it to public.
Any elegant solution that I'm missing?
PS: a call example that would fail with "You must provide an app access token or a user access token that is an owner or developer of the app" error due to lack of access token:
$tokenDebug = $fb->api('debug_token', array(
'input_token' => $token,
));
PPS: the "interesting" thing is that the error from above would appear not for every $token
but for some, and I cannot see any obvious distinction between tokens that fail and that succeed.
PPPS: $token
is a user access token
PPPPS: Created a feature request for FB PHP SDK https://developers.facebook.com/bugs/637897982899835
PPPPPS: Probably it could be better to create a pull request instead, but it's 1:30am and I'm too tired for that
$token
– Tuckieapp_id|app_secret
(both values concatenated with a pipe symbol in the middle) always works as app access token). – CynosuregetApplicationAccessToken()
actually does, but it's protected. What I would like to avoid - is a hardcodedapp_id|app_secret
in the client code. And that's why I asked about some elegant solution :-) – TuckiegetApplicationAccessToken
generates its token the same way, and ispublic
in the current SDK version, see github.com/facebook/facebook-php-sdk/blob/master/src/… – no idea what makes you think it was protected …? – Cynosuremaster
to check, so I think it's a good answer, could you please put it as an answer and my issue will be solved with the next stable release – Tuckieaccess_token => $this->getApplicationAccessToken()
if the API endpoint isdebug_token
so that consumers didn't care of it – TuckiedebugAccessToken($token)
? :-) – CynosuregetApplicationAccessToken()
since I already extend theFacebook
class. But I didn't like such a hack. Btw, creating a feature request, will add link to it to the question in a moment – Tuckie