When you successfully exchange a "code" for a token
facebook responses with the following (html body)
access_token=USER_ACCESS_TOKEN&expires=NUMBER_OF_SECONDS_UNTIL_TOKEN_EXPIRES
But what happens when this code for token exchange fails? how does facebook response when the exchange fails?
Reference https://developers.facebook.com/docs/howtos/login/server-side-login/
facebook can fail to return an access token to your application whenever one of the parameters in the request is incorrect. during development of my oauth framework i tested setting each required parameter to an incorrect value (ie i appended the string
123abc
to the start of the correct value). here are the results:wrong client id when requesting the access token from facebook, returns json error:
wrong client secret when requesting the access token from facebook, returns json error:
wrong code when requesting the access token from facebook, returns json error:
wrong grant type when requesting the access token from facebook, returns json error:
wrong scope when requesting the access token from facebook, returns json error:
and of course when i do not append
123abc
to the values then the access token is returned correctly in each case.these responses are as of december 2012, but of course facebook may decide to change them at any point in the future without warning.