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
- Failed to generate functions SSL
```appwrite-worker-certificates | Cannot renew domain (functions.domain.com) on attempt no. 9 certificate: Failed to verify domain DNS records. appwrite-worker...
- Dart 3.10 runtime on self-host 1.8.1
I added dart-3.10 runtime in .env file, applied the changes, but cannot see such option on console. is dart 3.10 not supported by self hosted 1.8.1? if not, whe...
- Guideline of AI
Hello everyone, I’m planning to specialize in Artificial Intelligence (AI) and I’m currently looking for guidance from someone with strong experience in the fi...