|
|
|
@ -119,7 +119,7 @@ public class PeisHttpApiHostModule : AbpModule |
|
|
|
builder.SetAccessTokenLifetime(TimeSpan.FromDays(30)).SetRefreshTokenLifetime(TimeSpan.FromDays(60)); |
|
|
|
//导入自定义证书,低版本windows要用openssl1.1.1生成
|
|
|
|
builder.AddEncryptionCertificate(new X509Certificate2(File.ReadAllBytes(context.Services.GetHostingEnvironment().WebRootPath + "\\encryption-certificate.pfx"), "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet)); |
|
|
|
builder.AddSigningCertificate(new X509Certificate2(File.ReadAllBytes(context.Services.GetHostingEnvironment().WebRootPath + "\\signing-certificate.pfx"), "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet)); |
|
|
|
builder.AddSigningCertificate(new X509Certificate2(File.ReadAllBytes(context.Services.GetHostingEnvironment().WebRootPath + "\\signing-certificate.pfx"), "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet)); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
@ -209,17 +209,19 @@ public class PeisHttpApiHostModule : AbpModule |
|
|
|
|
|
|
|
//context.Services.TryAddTransient<IAuthorizationMiddlewareResultHandler, AuthorizationMiddlewareResultHandler>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///解除https限制
|
|
|
|
context.Services.AddOpenIddict() |
|
|
|
.AddServer(option => |
|
|
|
{ |
|
|
|
option.SetIssuer(new Uri(configuration["AuthServer:IssuerBase"])); |
|
|
|
string issuerBase = configuration["AuthServer:IssuerBase"]; |
|
|
|
if (!string.IsNullOrWhiteSpace(issuerBase)) |
|
|
|
option.SetIssuer(new Uri(issuerBase)); |
|
|
|
option.UseAspNetCore().DisableTransportSecurityRequirement(); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//虚拟目录
|
|
|
|
context.Services.AddSingleton(new MyFileProvider(configuration["VirtualPath:RealPath"], configuration["VirtualPath:Alias"])); |
|
|
|
|