skip to Main Content

ASP.NET Core: No authentication handler registered for scheme 'Bearer' despite calling AddBearerToken in program.cs

I have program.cs: using System.Reflection; using HalfbitZadanie.Extensions; using InnoProducts.Models; using InnoProducts.Repositories; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddAuthorization(); builder.Services.AddAuthentication(options => {…

VIEW QUESTION
Back To Top
Search