// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddCors(o => o.AddPolicy("MyPolicy", builder => { builder.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader(); })); services.Configure <ApiBehaviorOptions>(options => { options.SuppressModelStateInvalidFilter = true; options.SuppressUseValidationProblemDetailsForInvalidModelStateResponses = false; }); JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); Installer.ConfigureServices(services, Configuration); Installer.ConfigureMongoDbIdentity(services); services.AddMvc(); RegisterAuth(services); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" }); }); }