aspnet core AddJwtBearer unable to find extension method

This might be abit too easy but sometimes it happens and then we need a proper solution. So just posting for so it can be helpful.

If you trying to do something like 

builder.Services.AddAuthentication() .AddCookie(options => { options.LoginPath = "/Account/Unauthorized/"; options.AccessDeniedPath = "/Account/Forbidden/"; }) .AddJwtBearer(options => { options.Audience = "http://localhost:5001/"; options.Authority = "http://localhost:5000/"; });


But getting unable to reference AddJwtBearer, just do this 

dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer



Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm