From 91cd73104211c3d9d8b7d84fea65958edd3ceb31 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Thu, 14 Sep 2023 15:19:33 +0300 Subject: [PATCH 1/6] Update data seeder for app-template --- .../ProjectBuilding/Templates/App/AppTemplateBase.cs | 4 ++++ .../appsettings.json | 10 ++++++++++ .../OpenIddict/OpenIddictDataSeedContributor.cs | 10 ++++++++++ 3 files changed, 24 insertions(+) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs index e8522f6f193..d57771c8cdd 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs @@ -399,6 +399,7 @@ protected void ConfigureWithoutUi(ProjectBuildContext context, List "OpenIddict": { "Applications": { + // "MyProjectName_Web": { "ClientId": "MyProjectName_Web", "ClientSecret": "1q2w3e*", "RootUrl": "https://localhost:44302" }, + // + // "MyProjectName_Blazor": { "ClientId": "MyProjectName_Blazor", "RootUrl": "https://localhost:44307" }, + // + // "MyProjectName_App": { "ClientId": "MyProjectName_App", "RootUrl": "http://localhost:4200" }, + // + // "MyProjectName_BlazorServerTiered": { "ClientId": "MyProjectName_BlazorServerTiered", "ClientSecret": "1q2w3e*", "RootUrl": "https://localhost:44309" }, + // + // "MyProjectName_Swagger": { "ClientId": "MyProjectName_Swagger", "RootUrl": "https://localhost:44305" } + // } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs index ccf35ec0269..a1af7f6b6af 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -79,6 +79,7 @@ private async Task CreateApplicationsAsync() var configurationSection = _configuration.GetSection("OpenIddict:Applications"); + // //Web Client var webClientId = configurationSection["MyProjectName_Web:ClientId"]; if (!webClientId.IsNullOrWhiteSpace()) @@ -103,7 +104,9 @@ await CreateApplicationAsync( postLogoutRedirectUri: $"{webClientRootUrl}signout-callback-oidc" ); } + // + // //Console Test / Angular Client var consoleAndAngularClientId = configurationSection["MyProjectName_App:ClientId"]; if (!consoleAndAngularClientId.IsNullOrWhiteSpace()) @@ -127,7 +130,9 @@ await CreateApplicationAsync( postLogoutRedirectUri: consoleAndAngularClientRootUrl ); } + // + // // Blazor Client var blazorClientId = configurationSection["MyProjectName_Blazor:ClientId"]; if (!blazorClientId.IsNullOrWhiteSpace()) @@ -147,7 +152,9 @@ await CreateApplicationAsync( postLogoutRedirectUri: $"{blazorRootUrl}/authentication/logout-callback" ); } + // + // // Blazor Server Tiered Client var blazorServerTieredClientId = configurationSection["MyProjectName_BlazorServerTiered:ClientId"]; if (!blazorServerTieredClientId.IsNullOrWhiteSpace()) @@ -170,7 +177,9 @@ await CreateApplicationAsync( postLogoutRedirectUri: $"{blazorServerTieredRootUrl}signout-callback-oidc" ); } + // + // // Swagger Client var swaggerClientId = configurationSection["MyProjectName_Swagger:ClientId"]; if (!swaggerClientId.IsNullOrWhiteSpace()) @@ -189,6 +198,7 @@ await CreateApplicationAsync( clientUri: swaggerRootUrl ); } + // } private async Task CreateApplicationAsync( From 9b80da6669da77eab71e2934fcf4906f078814a8 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Mon, 18 Sep 2023 14:04:37 +0300 Subject: [PATCH 2/6] app: Improve auth-server homepage design. --- .../MyProjectNameAuthServerModule.cs | 4 +- .../Pages/Index.cshtml | 86 +++++++++---------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs index 104fe9fed61..2a5a34c7e56 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs @@ -35,6 +35,7 @@ using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.UI; using Volo.Abp.VirtualFileSystem; +using Volo.Abp.Account.Localization; namespace MyCompanyName.MyProjectName; @@ -90,7 +91,8 @@ public override void ConfigureServices(ServiceConfigurationContext context) options.Resources .Get() .AddBaseTypes( - typeof(AbpUiResource) + typeof(AbpUiResource), + typeof(AccountResource) ); }); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml index 55b17f34532..bb61b5c264d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml @@ -16,6 +16,14 @@ Layout = Theme.GetEmptyLayout(); } +@section styles { + +} +
@@ -30,37 +38,30 @@

@BrandingProvider.AppName

}
+
- - -
-
- -
-
- @if (CurrentUser.IsAuthenticated) - { - - @L["Welcome"] @CurrentUser.UserName - - @CurrentUser.Email - - } - else - { - @L["Login"] - } -
- + +
+
+ @if (CurrentUser.IsAuthenticated) + { + + } + else + { + @L["Login"] + } +
- + +
@@ -78,16 +79,17 @@
-
- - @if (Model.Applications != null) - { - foreach (var application in Model.Applications) - { - - - + @if (Model.Applications != null) + { +
+ + + +
    + @foreach (var application in Model.Applications) + { +
  • @if (!application.LogoUri.IsNullOrEmpty()) {
    @@ -96,16 +98,12 @@ }

    @application.DisplayName

    - @application.ClientUri - - - - - } - } - + @application.ClientUri +
  • + } +
+
+ }
From 496ef1814ea76fe200562a9e3883d09d1382d5cf Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Mon, 18 Sep 2023 14:16:27 +0300 Subject: [PATCH 3/6] Update Index.cshtml --- .../Pages/Index.cshtml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml index bb61b5c264d..bd2643b53ab 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml @@ -85,11 +85,11 @@
- -
    - @foreach (var application in Model.Applications) - { -
  • + @foreach (var application in Model.Applications) + { + + + @if (!application.LogoUri.IsNullOrEmpty()) {
    @@ -98,10 +98,11 @@ }

    @application.DisplayName

    - @application.ClientUri -
  • - } -
+ @application.ClientUri + + +
+ }
}
From 031a421c765433eb6ddfa469efb8ab13b1e73e02 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:11:13 +0300 Subject: [PATCH 4/6] Update AppTemplateBase.cs --- .../Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs index d57771c8cdd..0060184b6c4 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs @@ -174,6 +174,7 @@ protected void DeleteUnrelatedProjects(ProjectBuildContext context, List Date: Tue, 19 Sep 2023 09:24:20 +0800 Subject: [PATCH 5/6] Add `returnUrl` to logout page. --- .../MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml index bd2643b53ab..fb4d0ba9ced 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml @@ -50,7 +50,7 @@ { } else From ddf13abbb3e1ad80be7e93e68da88f3d672f90c1 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:25:22 +0300 Subject: [PATCH 6/6] Update appsettings.json --- .../src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json index b589481948d..1797992d04b 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json @@ -35,12 +35,10 @@ "RootUrl": "https://localhost:44309" }, // - // "MyProjectName_Swagger": { "ClientId": "MyProjectName_Swagger", "RootUrl": "https://localhost:44305" } - // } } }