Securing Asp.Net Core Minimal APIs with a custom Middleware