chore 优化authserverAudience
This commit is contained in:
@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Cors;
|
|||||||
using Microsoft.AspNetCore.HttpOverrides;
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using OpenIddict.Validation;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
@ -26,6 +27,7 @@ using Volo.Abp.Localization;
|
|||||||
using Volo.Abp.Modularity;
|
using Volo.Abp.Modularity;
|
||||||
using Volo.Abp.OpenIddict;
|
using Volo.Abp.OpenIddict;
|
||||||
using Volo.Abp.Security.Claims;
|
using Volo.Abp.Security.Claims;
|
||||||
|
using Volo.Abp.UI.Navigation.Urls;
|
||||||
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
|
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
|
||||||
|
|
||||||
namespace KonSoft;
|
namespace KonSoft;
|
||||||
@ -50,7 +52,7 @@ public class KonSoftAuthServerModule : AbpModule
|
|||||||
{
|
{
|
||||||
builder.AddValidation(options =>
|
builder.AddValidation(options =>
|
||||||
{
|
{
|
||||||
options.AddAudiences("KonSoft");
|
options.AddAudiences(KonSoftConsts.AuthServerAudience);
|
||||||
options.UseLocalServer();
|
options.UseLocalServer();
|
||||||
options.UseAspNetCore();
|
options.UseAspNetCore();
|
||||||
});
|
});
|
||||||
@ -63,6 +65,11 @@ public class KonSoftAuthServerModule : AbpModule
|
|||||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Configure<OpenIddictServerBuilder>(options =>
|
||||||
|
{
|
||||||
|
options.SetIssuer("");
|
||||||
|
});
|
||||||
|
|
||||||
if (!hostingEnvironment.IsDevelopment())
|
if (!hostingEnvironment.IsDevelopment())
|
||||||
{
|
{
|
||||||
PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
|
PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
|
||||||
|
|||||||
Reference in New Issue
Block a user