Sascha Manns

Software- & Dataengineer

.NET C# Programming Language and .NET Platform

Minimal API-Key Lösung

Problem Ich suchte nach einer Lösung, die mit minimalem Aufwand eine Minimallösung für API-Schlüssel bereitstellt. Lösung ApiKeyMiddleware: public class ApiKeyMiddleware { private readonly RequestDelegate _next; private const string APIKEYNAME = "ApiKey"; public ApiKeyMiddleware(RequestDelegate next) { _next = next; } public async Task InvokeAsync(HttpContext context) {
.NET Lesson learned