Search code examples
restfb

RestFB - How to verify Application Id from received User Access Token


In RestFB, after getting Facebook Client Object through User access token

FacebookClient facebookClient = new DefaultFacebookClient(accessToken, VERSION_2_12);

How to verify the application Id for which the access token is issued?


Solution

  • First you need your app access token. Then make a debug call on it like this:

    FacebookClient appFacebookClient = new DefaultFacebookClient(appToken, Version.VERSION_2_12);
    DebugTokenInfo tokenInfo = appFacebookClient.debugToken(accessToken);
    

    Afterwards, you check the content of the tokenInfo object.