Im trying to add bearer authentication to swagger api, im very poor with this case and im trying to know something (im 14...) the case is that, the ApiKeyScheme is not found for me... there is my code:
c.AddSecurityDefinition("Bearer",
new ApiKeyScheme { In = "header",
Description = "Please enter into field the word 'Bearer' following by space and JWT",
Name = "Authorization", Type = "apiKey" });
c.AddSecurityRequirement(new Dictionary<string, IEnumerable<string>> {
{ "Bearer", Enumerable.Empty<string>() },
});
And those are my libraries:
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.EntityFrameworkCore;
using EdictApi.Models;
using Microsoft.OpenApi.Models;
using System;
using System.Linq;
And im so confused with it, can someone calm explain me this? :)