aspnetcore-authentication-apikey
aspnetcore-authentication-apikey copied to clipboard
Noise logs "No Api Key found in the request." for controller without [AllowAnonymous] attribute
Using V6.0 we got a lot of noise LogInformation("No Api Key found in the request."); for controller that doesn't have any attributes. According to documentation we should set IgnoreAuthenticationIfAllowAnonymous and specify [AllowAnonymous] for every controller/method that doesn't need authentication.
Is it possible to [AllowAnonymous] by default to all controllers in startup without adding individual [AllowAnonymous] attributes?
We noticed that older version 2.2. doesn't have such noise log entries
IgnoreAuthenticationIfAllowAnonymous and AllowAnonymous still not stopping the log "No Api Key found in the request".
Version: 6.0.1 - Install-Package AspNetCore.Authentication.ApiKey -Version 6.0.1
I have also noticed the "No Api Key found in the request" error will appear if multiple authentication methods are specified for the same location. For example, if you have specified several schemes for AddApiKeyInHeader.
Version: 6.0.1
I have just published version 7.0.0 where I have changed the level of this log from Information to Debug. I hope this helps.