|
|
|
@ -17,6 +17,7 @@ using MyCompanyName.MyProjectName.MultiTenancy; |
|
|
|
using StackExchange.Redis; |
|
|
|
using Microsoft.OpenApi.Models; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.AspNetCore.Authentication.JwtBearer; |
|
|
|
using Volo.Abp.AspNetCore.Mvc; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; |
|
|
|
using Volo.Abp.AspNetCore.Serilog; |
|
|
|
@ -39,6 +40,7 @@ namespace MyCompanyName.MyProjectName; |
|
|
|
typeof(AbpCachingStackExchangeRedisModule), |
|
|
|
typeof(AbpDistributedLockingModule), |
|
|
|
typeof(AbpAspNetCoreMvcUiMultiTenancyModule), |
|
|
|
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), |
|
|
|
typeof(MyProjectNameApplicationModule), |
|
|
|
typeof(MyProjectNameEntityFrameworkCoreModule), |
|
|
|
typeof(AbpAspNetCoreSerilogModule), |
|
|
|
@ -101,7 +103,7 @@ public class MyProjectNameHttpApiHostModule : AbpModule |
|
|
|
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) |
|
|
|
{ |
|
|
|
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) |
|
|
|
.AddJwtBearer(options => |
|
|
|
.AddAbpJwtBearer(options => |
|
|
|
{ |
|
|
|
options.Authority = configuration["AuthServer:Authority"]; |
|
|
|
options.RequireHttpsMetadata = configuration.GetValue<bool>("AuthServer:RequireHttpsMetadata"); |
|
|
|
|