sync with OpenAuth.Core

This commit is contained in:
yubaolee
2020-12-27 00:00:28 +08:00
parent 368eae8d63
commit 20a717b2e6
19 changed files with 451 additions and 199 deletions

View File

@@ -4,10 +4,10 @@ using System.IO;
using System.Linq;
using Autofac;
using IdentityServer4.AccessTokenValidation;
using Infrastructure.Extensions;
using Infrastructure.Extensions.AutofacManager;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
@@ -38,6 +38,11 @@ namespace OpenAuth.WebApi
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<ApiBehaviorOptions>(options =>
{
options.SuppressModelStateInvalidFilter = true;
});
services.AddSingleton(provider =>
{
var service = provider.GetRequiredService<ILogger<StartupLogger>>();
@@ -161,8 +166,10 @@ namespace OpenAuth.WebApi
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostEnvironment env)
public void Configure(IApplicationBuilder app, IHostEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddLog4Net();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();