0

I'm making a canvas game on Facebook, using html/js (and a little php). I'm trying to use the facebook users id, to login or create a similar parse.com user, to store relevant game data for the user.

I'am using this function (straight from tutorial):

function getLoginParamsFromAuthResponse(authResponse) {
  return {
     id: authResponse.userID,
     access_token: authResponse.accessToken,
    expiration_date: convertExpiryDate(authResponse.expiresIn)
  };
}

When printing out the accessToken, and using facebook debug tool, it is found to be valid.

I reviece the following error when the code is executed on facebook:

POST https://api.parse.com/1/users 400 (Bad Request) parse-1.2.16.min.js:1

e.Error {code: 251, message: "Parse::InvalidSessionError"}

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • I was getting something similar - I think in my case it was because I was sending `id` as an integer when it should have been a string. It could also be that `expiration_date` is not in the format that Parse expects it to be. – Jay Nebhwani Feb 16 '14 at 22:34
  • I think I found the reason. It seem to be cause by the date.getDay() method, that facebook tutorial suggests for sending the expiration_date. This method returns 0-6, and causes a error from parse on sundays (value = 0). The method should instead be date.getDate() as it returns 01-31 – user3317007 Feb 24 '14 at 15:49

0 Answers0