I want to validate if the webhook was indeed from Appwrite and it works if the payload does not include special UTF-8 characters like ä,ü,ö etc. But when the payload includes these characters the hash/signature is diffrent...
I use C# for validateing the hash... here is the code:
string payload;
using var reader = new StreamReader(context.Request.InputStream, Encoding.UTF8);
payload = await reader.ReadToEndAsync();
string signature = _webHookUrl + payload.Trim();
string hash = Convert.ToBase64String(hMACSHA1.ComputeHash(Encoding.UTF8.GetBytes(signature)));
if (!context.Request?.Headers?.Get("x-appwrite-webhook-signature")?.Equals(hash) ?? true)
{
// Error hash is invalid
return;
}
Recommended threads
- SELF HOSTING ISSUE, DATA NOT MIGRATING T...
Hey, devs, I recently tried to migrate my cloud instance to a self hosted version but my data is not transferred fully only the table structure is transferred ...
- No Document ID?
Hi I have a self hosted appwrite. My documents get a document ID but are not visible in the console. I don't know why this happens and how to fix this
- How to determine if a user is anonymous?
This is probably a silly question, but I have not yet found a good answer. Is there a method to determine if the current session is anonymous aside from seein...