Skip to main content
Read and evaluate a stored identification, then verify raw-body webhook signatures in your backend. This guide uses the supported ShieldLabs package API, not a standalone generated client.

Before you start

The example uses the .NET 8 SDK and ASP.NET Core. The library also targets .NET Standard 2.0. Register and verify the website domain in your analytics dashboard. Use credentials from the same domain and environment as the browser check. For a fresh account, start with Quick Start.

Get your credentials

Copy the domain’s Private API Key from Integration > API keys and store it as SHIELDLABS_API_KEY in your server environment. For webhook verification, also set SHIELDLABS_WEBHOOK_SECRET from Integration > Webhooks. Never expose either secret to the browser.

Install the SDK

Add the integration

Both server-side halves in one ASP.NET Core app. Create it with dotnet new web, run dotnet add package ShieldLabs, replace Program.cs with the code below, set SHIELDLABS_API_KEY (Private API Key, sec_...) and SHIELDLABS_WEBHOOK_SECRET (endpoint signing secret, whsec_...), then dotnet run.
POST /signup with {"requestId":"..."} answers 200 with the band, 403 with a reason (missing, replayed, stale, rate_limited, no_device_signals, blocked_flag, blocked_band), 400 for a malformed request ID and 503 when the verdict could not be read. A fuller app with the same routes lives in examples/MinimalApi.

Test the complete flow

  1. Use the Request ID from a real browser check on the same domain as the Private API Key.
  2. Confirm the server retrieves that identification and its Risk Score.
  3. Test an invalid or missing ID and an unavailable API: none should be treated as a clean identification.
  4. For webhooks, test the original raw body with its signature, then change one byte and confirm rejection.
In-memory replay stores in examples are demonstrations, not shared production storage. Claim accepted IDs atomically in a durable database or cache, enforce freshness, authenticate the action, and check the expected domain and user association. Reading a valid identification alone does not authorize a business action.

Troubleshooting

  • No History row: confirm the registered domain, credential/environment match and that the browser remained open while collectors posted.
  • Missing or pending verdict: scoring is asynchronous. The server helper waits within a bounded budget; handle a missing result and API errors explicitly.
  • Authentication error: use the Private API Key for History, not a Public Key, Management Secret Key or MCP OAuth token.
  • Invalid webhook signature: verify the original raw bytes with the endpoint’s full signing secret, before trusting parsed JSON.

Next steps