AspNetCore Authentication Deprecated problem

Cenk 946 Reputation points
2023-07-30T16:27:31.6366667+00:00

Hi guys,

I am working on an Asp.Net Core 7 web API project. (using .NET 7) I got this deprecated message when I open Nuget package manager for Microsoft.AspNetCore.Authentication 2.2 and Microsoft.AspNetCore.Http 2.2.2. How can I fix them?

Thank you.

Ekran görüntüsü 2023-07-30 191830

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,002 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Zhi Lv - MSFT 29,776 Reputation points Microsoft Vendor
    2023-07-31T01:58:36.21+00:00

    Hi @Cenk

    You can uninstall these packages, because they are obsolete and has been deprecated as part of the .NET Package Deprecation effort.

    To the authentication, you can use the following packages:

    Then, to send Http Request, there is no need to install additional package, you can register the HttpClient service using AddHttpClient(), then use IHttpClientFactory or HttpClient to send Http Request. More detail information, see Make HTTP requests using IHttpClientFactory in ASP.NET Core.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,

    Dillion

    1 person found this answer helpful.

  2. Christian Lichtenberger 0 Reputation points
    2023-11-23T09:35:13.69+00:00

    I implemented a custom authentication handler and needs to derive from a class defined in Microsoft.AspNetCore.Authentication.

    To solve that the answer in following issue helped my:

    https://github.com/dotnet/AspNetCore.Docs/issues/29655

    0 comments No comments