I'm designing a Facebook canvas app, and am just at the beginning. To test that I can communicate with Facebook correctly at all, I am trying to read the JSON object that Facebook sends to my page, named "signed_request". Every method I try to use to read it claims that the base64 JSON object data is invalid. For example, using the JSON.net library, in vb.net, with this code:
Dim mystring As String
mystring = JsonConvert.DeserializeObject(request.form("signed_request"))
I get this error:
Newtonsoft.Json.JsonReaderException: Error parsing boolean value. Line 1, position 2.
Or, when using built-in string conversion functions with this code:
Dim b As Byte() = Convert.FromBase64String(request.form("signed_request"))
mystring = System.Text.Encoding.UTF8.GetString(b)
System.FormatException: Invalid character in a Base-64 string.
What am I doing wrong?