How to replace AddJwtBearer extension in .NET Core 3.0

Like Mert Sayin says, include package Microsoft.AspNetCore.Authentication.JwtBearer, but use Version 3.0.0.


Something like this:

services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, options => Configuration.Bind("JwtSettings", options)) .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options => Configuration.Bind("CookieSettings", options));

From here: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/?view=aspnetcore-3.1


You must include Microsoft.AspNetCore.Authentication.JwtBearer package to your project, with version 3.0.0 for Core 3.0 and above.