I have a class library targeting .NET Standard 2.0 which contains custom authentication logic for ASP.NET (Core+) web applications. For example, it has an implementation of AuthenticationHandler along with applicable subclass of AuthenticationSchemeOptions and so forth. All of these are found in the Microsoft.AspNetCore.Authentication namespace.
In making a few minor updates to this lib, I noticed that one of the packages it relies on, Microsoft.AspNetCore.Authentication (v2.2.0) is deprecated. I want to fix that if possible without breaking backwards compatibility. Obviously it's quite core as it's what's providing the aforementioned functionality.
Is there an alternative package I can use to do this? The deprecation notice does not give any suggestions and I can't find anything anywhere else either. I've found a similar (although different, as it relates specifically to a Web API project) question here on SO but it has no satisfactory answers.
As I see it, I have the following options, none of which are ideal:
- Leave it as it is. Doesn't seem a good long-term approach.
- Update to a new .NET version (e.g. .NET 6). Maybe that will fix it? Maybe that namespace is now within the framework? Not sure. It'll break my package for older .NET versions though.
- Revert the package version from v2.2.0 to v2.1.2. Oddly that's not marked as deprecated - although that definitely seems like an oddity so not sure if that's intentional or a mistake that some of the 2.1.x line are this way.
I'm hoping I'm missing the proper solution somewhere.