You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During compilation the following warning is generated: /root/.nuget/packages/aspnetcore.authentication.apikey/8.0.1/lib/net8.0/AspNetCore.Authentication.ApiKey.dll : warning IL2104: Assembly 'AspNetCore.Authentication.ApiKey' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries
And during runtime, when a challenge occurs, this error is logged: System.InvalidOperationException: A suitable constructor for type 'AspNetCore.Authentication.ApiKey.ApiKeyInHeaderHandler' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.
This happens both when implementing IApiKeyProvider as well as when adding OnValidateKey on ApiKeyEvents in ApiKeyOptions.Events
It seems something is happening with AspNetCore.Authentication.ApiKey.ApiKeyInHeaderHandler during trimming, as the type itself is found but not a (fitting) constructor.
At this time, I do not know enough about how AOT works to pinpoint what exactly is causing these problems, however, the documentation about Asp.Net' AOT support notes that only JWT Authentication is fully supported, so it seems to be not uncommon for auth schemes to require extra work to function.
The text was updated successfully, but these errors were encountered:
During compilation the following warning is generated:
/root/.nuget/packages/aspnetcore.authentication.apikey/8.0.1/lib/net8.0/AspNetCore.Authentication.ApiKey.dll : warning IL2104: Assembly 'AspNetCore.Authentication.ApiKey' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries
And during runtime, when a challenge occurs, this error is logged:
System.InvalidOperationException: A suitable constructor for type 'AspNetCore.Authentication.ApiKey.ApiKeyInHeaderHandler' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.
This happens both when implementing
IApiKeyProvider
as well as when addingOnValidateKey
onApiKeyEvents
inApiKeyOptions.Events
It seems something is happening with
AspNetCore.Authentication.ApiKey.ApiKeyInHeaderHandler
during trimming, as the type itself is found but not a (fitting) constructor.At this time, I do not know enough about how AOT works to pinpoint what exactly is causing these problems, however, the documentation about Asp.Net' AOT support notes that only JWT Authentication is fully supported, so it seems to be not uncommon for auth schemes to require extra work to function.
The text was updated successfully, but these errors were encountered: