Webhook's signature verification
📋 Prepare configuration options
1. Define a configuration class:
public class CakewalkApiOptions
{
public const string SectionName = "CakewalkApi";
public string ApiKey { get; set; } = string.Empty;
public string ApiSecret { get; set; } = string.Empty;
public string PublicKeyEndpoint { get; set; } = "<https://open-api.getcakewalk.io/api/Keys>";
}
2. Register configuration in Program.cs or Startup.cs:
Program.cs or Startup.cs:builder.Services.Configure<CakewalkApiOptions>(
builder.Configuration.GetSection(CakewalkApiOptions.SectionName));
🔐 Signature Verification with Remote Public Key
SignatureService Implementation:
SignatureService Implementation:🧪 Interface and Registration
Interface:
Dependency Injection in Program.cs:
Program.cs:🛡️ Implement the webhook endpoint with the validation logic
✅ Sample appsettings.json or environment variables
appsettings.json or environment variablesLast updated
Was this helpful?