|
|
@ -4,10 +4,13 @@ using Microsoft.AspNetCore.Hosting;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.OpenApi.Models;
|
|
|
|
using Microsoft.OpenApi.Models;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.AspNetCore.Authentication;
|
|
|
|
using Microsoft.AspNetCore.Authentication;
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
|
|
|
using Microsoft.AspNetCore.DataProtection;
|
|
|
|
using Microsoft.AspNetCore.DataProtection;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
|
|
|
|
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
|
|
|
|
using MyCompanyName.MyProjectName.Localization;
|
|
|
|
using MyCompanyName.MyProjectName.Localization;
|
|
|
|
using MyCompanyName.MyProjectName.MultiTenancy;
|
|
|
|
using MyCompanyName.MyProjectName.MultiTenancy;
|
|
|
@ -15,6 +18,8 @@ using MyCompanyName.MyProjectName.Web;
|
|
|
|
using StackExchange.Redis;
|
|
|
|
using StackExchange.Redis;
|
|
|
|
using Volo.Abp;
|
|
|
|
using Volo.Abp;
|
|
|
|
using Volo.Abp.AspNetCore.Authentication.OAuth;
|
|
|
|
using Volo.Abp.AspNetCore.Authentication.OAuth;
|
|
|
|
|
|
|
|
using Volo.Abp.AspNetCore.Authentication.OpenIdConnect;
|
|
|
|
|
|
|
|
using Volo.Abp.AspNetCore.MultiTenancy;
|
|
|
|
using Volo.Abp.AspNetCore.Mvc.Client;
|
|
|
|
using Volo.Abp.AspNetCore.Mvc.Client;
|
|
|
|
using Volo.Abp.AspNetCore.Mvc.Localization;
|
|
|
|
using Volo.Abp.AspNetCore.Mvc.Localization;
|
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI;
|
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI;
|
|
|
@ -47,7 +52,7 @@ namespace MyCompanyName.MyProjectName
|
|
|
|
[DependsOn(
|
|
|
|
[DependsOn(
|
|
|
|
typeof(MyProjectNameWebModule),
|
|
|
|
typeof(MyProjectNameWebModule),
|
|
|
|
typeof(MyProjectNameHttpApiClientModule),
|
|
|
|
typeof(MyProjectNameHttpApiClientModule),
|
|
|
|
typeof(AbpAspNetCoreAuthenticationOAuthModule),
|
|
|
|
typeof(AbpAspNetCoreAuthenticationOpenIdConnectModule),
|
|
|
|
typeof(AbpAspNetCoreMvcClientModule),
|
|
|
|
typeof(AbpAspNetCoreMvcClientModule),
|
|
|
|
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
|
|
|
|
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
|
|
|
|
typeof(AbpAutofacModule),
|
|
|
|
typeof(AbpAutofacModule),
|
|
|
@ -136,7 +141,7 @@ namespace MyCompanyName.MyProjectName
|
|
|
|
{
|
|
|
|
{
|
|
|
|
options.ExpireTimeSpan = TimeSpan.FromDays(365);
|
|
|
|
options.ExpireTimeSpan = TimeSpan.FromDays(365);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.AddOpenIdConnect("oidc", options =>
|
|
|
|
.AddAbpOpenIdConnect("oidc", options =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
options.Authority = configuration["AuthServer:Authority"];
|
|
|
|
options.Authority = configuration["AuthServer:Authority"];
|
|
|
|
options.RequireHttpsMetadata = false;
|
|
|
|
options.RequireHttpsMetadata = false;
|
|
|
@ -152,9 +157,6 @@ namespace MyCompanyName.MyProjectName
|
|
|
|
options.Scope.Add("email");
|
|
|
|
options.Scope.Add("email");
|
|
|
|
options.Scope.Add("phone");
|
|
|
|
options.Scope.Add("phone");
|
|
|
|
options.Scope.Add("MyProjectName");
|
|
|
|
options.Scope.Add("MyProjectName");
|
|
|
|
|
|
|
|
|
|
|
|
options.ClaimActions.MapJsonKey(AbpClaimTypes.UserName, "name");
|
|
|
|
|
|
|
|
options.ClaimActions.DeleteClaim("name");
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|