When facebook loads my app into the iframe I get in the POST data the signed_request parameter, I then take the part after the "." and decode that with base64 to get the json string representation of the signed request.
For some reason the json string that is decoded from the signed request is incomplete and looks like this (formatted for easy reading):
{
"algorithm": "HMAC-SHA256",
"expires": xxxxxxxxxxx,
"issued_at": xxxxxxxxxx,
"oauth_token": "xxxxxxxxxxxxxxxxxxxxxxxx",
"user": {
"country": "il",
"locale": "en_US",
"age": {
"min": 21
}
},
"user_id":"xxxxxxxxx
The user_id is correct and complete but then the rest of the string is missing the closing double quote and the closing bracket. This happens to me every time now with my app, it's on sandbox mode.
Any ideas of why this happens? Thanks.
Edit
I checked that it's not some decoding error in my program, I copied the content that is being posted and checked it in an online decoder and got the exact same result.