services.AddAuthentication(IISDefaults.AuthenticationScheme);
var userName = _httpContextAccessor.HttpContext.User.Identity.Name;
services.AddCors(options => { options.AddPolicy("AllowAll", builder => { builder .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader(); }); });
app.UseCors("AllowAll");