I am migrating a Web API that has Swagger documenation generated using Swashbuckle from .NET Framework to ASP.NET Core. In the new AspNetCore version I'm using Swashbuckle.AspNetCore v5.0.0-rc2.
This is an internal service and authentication uses an API key provided in a custom HTTP header. In the .NET Framework application, I configured Swashbuckle to enable my API key as follows:
c.ApiKey("apiKey")
.Description("My description")
.Name("MyHttpHeaderName")
.In("header);
and
c.EnableApiKeySupport("MyHtpHeaderName", "header);
How can I enable support for the same API key using Swashbuckle.AspNetCore v5.0.0-rc2?
Much of the information I've found by searching seems to relate to versions of Swashbuckle.AspNetCode prior to v5.0.0-rc2.
This answer is for v5.0.0-rc2 but only covers Bearer Authorization, and doesn't seem to relate to using a custom HTTP header: https://stackoverflow.com/a/57872872/13087