For some reason, I kept getting "invalid_token" or "invalid token" with no trace of any other information.
Turns out, C# and the WebSocket were appending \0 at the end of the data. D'oh!
The simple fix for this (when you're having issues with JSON.parse) is to change your code from:
var jsonObject = JSON.parse(jsonEncodedString);
to
var jsonObject = JSON.parse(jsonEncodedString.replace(/\0/g, ""));
With that, your code should hopefully work! If not, there's always http://jsonlint.com/ to attempt to validate your JSON.