|
|
|
@ -1,6 +1,5 @@ |
|
|
|
using System; |
|
|
|
using System.IO; |
|
|
|
using System.Net.Http; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Blazorise.Bootstrap5; |
|
|
|
using Blazorise.Icons.FontAwesome; |
|
|
|
@ -16,7 +15,6 @@ using MyCompanyName.MyProjectName.MultiTenancy; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Account; |
|
|
|
using Volo.Abp.Account.Web; |
|
|
|
using Volo.Abp.AspNetCore.Authentication.JwtBearer; |
|
|
|
using Volo.Abp.AspNetCore.Components.Server.BasicTheme; |
|
|
|
using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling; |
|
|
|
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing; |
|
|
|
@ -48,7 +46,6 @@ using Volo.Abp.Swashbuckle; |
|
|
|
using Volo.Abp.TenantManagement; |
|
|
|
using Volo.Abp.TenantManagement.Blazor.Server; |
|
|
|
using Volo.Abp.TenantManagement.EntityFrameworkCore; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
using Volo.Abp.UI.Navigation; |
|
|
|
using Volo.Abp.UI.Navigation.Urls; |
|
|
|
using Volo.Abp.VirtualFileSystem; |
|
|
|
@ -62,7 +59,6 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host; |
|
|
|
typeof(AbpAspNetCoreMvcUiBasicThemeModule), |
|
|
|
typeof(AbpAutofacModule), |
|
|
|
typeof(AbpSwashbuckleModule), |
|
|
|
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), |
|
|
|
typeof(AbpAspNetCoreSerilogModule), |
|
|
|
typeof(AbpAccountWebOpenIddictModule), |
|
|
|
typeof(AbpAccountApplicationModule), |
|
|
|
@ -100,13 +96,6 @@ public class MyProjectNameBlazorHostModule : AbpModule |
|
|
|
); |
|
|
|
}); |
|
|
|
|
|
|
|
PreConfigure<OpenIddictServerBuilder>(builder => |
|
|
|
{ |
|
|
|
// https://documentation.openiddict.com/configuration/token-formats.html#disabling-jwt-access-token-encryption
|
|
|
|
// In production, it is recommended to use two RSA certificates, distinct from the certificate(s) used for HTTPS: one for encryption, one for signing.
|
|
|
|
builder.DisableAccessTokenEncryption(); |
|
|
|
}); |
|
|
|
|
|
|
|
PreConfigure<OpenIddictBuilder>(builder => |
|
|
|
{ |
|
|
|
builder.AddValidation(options => |
|
|
|
@ -151,14 +140,6 @@ public class MyProjectNameBlazorHostModule : AbpModule |
|
|
|
); |
|
|
|
}); |
|
|
|
|
|
|
|
context.Services.AddAuthentication() |
|
|
|
.AddJwtBearer(options => |
|
|
|
{ |
|
|
|
options.Authority = configuration["AuthServer:Authority"]; |
|
|
|
options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); |
|
|
|
options.Audience = "MyProjectName"; |
|
|
|
}); |
|
|
|
|
|
|
|
if (hostingEnvironment.IsDevelopment()) |
|
|
|
{ |
|
|
|
Configure<AbpVirtualFileSystemOptions>(options => |
|
|
|
@ -253,7 +234,7 @@ public class MyProjectNameBlazorHostModule : AbpModule |
|
|
|
app.UseStaticFiles(); |
|
|
|
app.UseRouting(); |
|
|
|
app.UseAuthentication(); |
|
|
|
app.UseJwtTokenMiddleware(); |
|
|
|
app.UseAbpOpenIddictValidation(); |
|
|
|
|
|
|
|
if (MultiTenancyConsts.IsEnabled) |
|
|
|
{ |
|
|
|
|