diff --git a/Directory.Packages.props b/Directory.Packages.props
index 1cb2ae0b88..920232ee86 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -106,6 +106,7 @@
+
diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj b/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj
index d43da06dde..4d7b852b9c 100644
--- a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj
@@ -23,6 +23,9 @@
+
+
+
diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj b/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj
index 702b1e2ed5..4542fc4cb5 100644
--- a/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj
@@ -16,6 +16,7 @@
+
diff --git a/modules/openiddict/app/OpenIddict.Demo.API/OpenIddict.Demo.API.csproj b/modules/openiddict/app/OpenIddict.Demo.API/OpenIddict.Demo.API.csproj
index a04d196bf0..cf0cd880b2 100644
--- a/modules/openiddict/app/OpenIddict.Demo.API/OpenIddict.Demo.API.csproj
+++ b/modules/openiddict/app/OpenIddict.Demo.API/OpenIddict.Demo.API.csproj
@@ -8,7 +8,8 @@
-
+
+
diff --git a/modules/openiddict/app/OpenIddict.Demo.API/OpenIddictApiModule.cs b/modules/openiddict/app/OpenIddict.Demo.API/OpenIddictApiModule.cs
new file mode 100644
index 0000000000..cdf2399808
--- /dev/null
+++ b/modules/openiddict/app/OpenIddict.Demo.API/OpenIddictApiModule.cs
@@ -0,0 +1,14 @@
+using Volo.Abp.AspNetCore.Authentication.JwtBearer;
+using Volo.Abp.AspNetCore.Mvc;
+using Volo.Abp.Modularity;
+
+namespace OpenIddict.Demo.API;
+
+[DependsOn(
+ typeof(AbpAspNetCoreMvcModule),
+ typeof(AbpAspNetCoreAuthenticationJwtBearerModule)
+)]
+public class OpenIddictApiModule : AbpModule
+{
+
+}
diff --git a/modules/openiddict/app/OpenIddict.Demo.API/Program.cs b/modules/openiddict/app/OpenIddict.Demo.API/Program.cs
index c40a46ad60..4d56464b50 100644
--- a/modules/openiddict/app/OpenIddict.Demo.API/Program.cs
+++ b/modules/openiddict/app/OpenIddict.Demo.API/Program.cs
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Authentication.JwtBearer;
+using OpenIddict.Demo.API;
var builder = WebApplication.CreateBuilder(args);
builder.Logging.ClearProviders();
@@ -22,13 +23,15 @@ builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
- .AddJwtBearer(options =>
+ .AddAbpJwtBearer(options =>
{
options.Authority = "https://localhost:44301";
options.Audience = "AbpAPIResource";
});
+await builder.AddApplicationAsync();
var app = builder.Build();
+await app.InitializeApplicationAsync();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
@@ -38,11 +41,16 @@ if (app.Environment.IsDevelopment())
}
app.UseHttpsRedirection();
-
+app.UseRouting();
app.UseCors();
app.UseAuthentication();
app.UseAuthorization();
-
-app.MapControllers();
-
+app.UseConfiguredEndpoints(options =>
+{
+ options.MapFallback("{**slug}", context =>
+ {
+ context.Response.Redirect("/swagger");
+ return Task.CompletedTask;
+ });
+});
app.Run();
diff --git a/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/OpenIddict.Demo.Client.Mvc.csproj b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/OpenIddict.Demo.Client.Mvc.csproj
index de9010eadf..f4a7e24d6e 100644
--- a/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/OpenIddict.Demo.Client.Mvc.csproj
+++ b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/OpenIddict.Demo.Client.Mvc.csproj
@@ -8,7 +8,8 @@
-
+
+
diff --git a/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/OpenIddictMvcModule.cs b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/OpenIddictMvcModule.cs
new file mode 100644
index 0000000000..53693de823
--- /dev/null
+++ b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/OpenIddictMvcModule.cs
@@ -0,0 +1,14 @@
+using Volo.Abp.AspNetCore.Authentication.OpenIdConnect;
+using Volo.Abp.AspNetCore.Mvc;
+using Volo.Abp.Modularity;
+
+namespace OpenIddict.Demo.Client.Mvc;
+
+[DependsOn(
+ typeof(AbpAspNetCoreMvcModule),
+ typeof(AbpAspNetCoreAuthenticationOpenIdConnectModule)
+)]
+public class OpenIddictMvcModule : AbpModule
+{
+
+}
diff --git a/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Index.cshtml b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Index.cshtml
index 51646646d1..dc32cca59c 100644
--- a/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Index.cshtml
+++ b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Index.cshtml
@@ -1,6 +1,7 @@
@page
-@using Microsoft.AspNetCore.Authentication
+@using System.Net.Http
@using System.Net.Http.Headers
+@using Microsoft.AspNetCore.Authentication
@using System.Text.Json
@model IndexModel
@{
diff --git a/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Shared/_Layout.cshtml b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Shared/_Layout.cshtml
index d7f0e61a5b..f3e8499ba7 100644
--- a/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Shared/_Layout.cshtml
+++ b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Shared/_Layout.cshtml
@@ -6,7 +6,6 @@
@ViewData["Title"] - OpenIddict.Demo.Client
-
@@ -48,4 +47,4 @@
@await RenderSectionAsync("Scripts", required: false)
-