I thought I would try and get the new Signed Request logic added to my facebook canvas application, to make this \"easy\" on myself I went to the facebook PHP sdk over at Gi
Thank, James! Your code helped me a lot.
cdpnet, add like Newtonsoft.Json to your project, and then it's this:
JObject UnencodedPayload = JObject.Parse(Encoding.GetString(ActualPayload));
-Kevin
You are not supposed to base64-decode the payload before calculating the HMAC.
Use this line:
var Hmac = SignWithHMAC(Encoding.GetBytes(Payload), Encoding.GetBytes(ApplicationSecret));
and it should work.
A few more pointers:
Substring() and IndexOf() try using String.Split()var applicationSecret = "...";)