comparison default/assets/vendors/theme-widgets/vendor/mute/facebook/example/extending-tokens.php @ 0:1d038bc9b3d2 default tip

Up:default
author Liny <dev@neowd.com>
date Sat, 31 May 2025 09:21:51 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d038bc9b3d2
1 <?php
2
3 /**
4 * Debugging Access Tokens and Handling Errors
5 *
6 * In most cases when an app receives an Access Token, it will also receive an
7 * expires parameter which indicates when you can expect that token to expire.
8 * However, there are several events which can cause an access token to become
9 * invalid before its expected expiry time. Examples include: when a user
10 * changes their password, when a user de-authorizes an application, or when an
11 * App's Secret is reset.
12 *
13 * @author Xavier Barbosa
14 * @since 13 February, 2013
15 * @link https://developers.facebook.com/docs/howtos/login/debugging-access-tokens/
16 **/
17
18 use Mute\Facebook\App;
19
20 /**
21 * Default params
22 **/
23
24 $app_id = "YOUR_APP_ID";
25 $app_secret = "YOUR_APP_SECRET";
26 $access_token = 'TOKEN_TO_DEBUG';
27
28 /**
29 * The process
30 **/
31
32 $app = new App($app_id, $app_secret);
33 $response = $app->get('debug_token', array('input_token' => $access_token));
34
35 var_dump($response);