From f5101c69e6dd3cc404b7b88261a617cea6bf0bb0 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 20 Oct 2022 22:53:18 -0400 Subject: [PATCH 1/4] Added optional params for swagger auth --- .../AbpSwaggerGenServiceCollectionExtensions.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs b/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs index 5ba2d7ee099..ad350517804 100644 --- a/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs +++ b/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs @@ -33,8 +33,13 @@ public static IServiceCollection AddAbpSwaggerGenWithOAuth( this IServiceCollection services, [NotNull] string authority, [NotNull] Dictionary scopes, + string authorizationEndpoint = "/connect/authorize", + string tokenEndpoint = "/connect/token", Action setupAction = null) { + var authorizationUrl = new Uri($"{authority.TrimEnd('/')}{authorizationEndpoint.EnsureStartsWith('/')}"); + var tokenUrl = new Uri($"{authority.TrimEnd('/')}{tokenEndpoint.EnsureStartsWith('/')}"); + return services .AddAbpSwaggerGen() .AddSwaggerGen( @@ -47,9 +52,9 @@ public static IServiceCollection AddAbpSwaggerGenWithOAuth( { AuthorizationCode = new OpenApiOAuthFlow { - AuthorizationUrl = new Uri($"{authority.EnsureEndsWith('/')}connect/authorize"), + AuthorizationUrl = authorizationUrl, Scopes = scopes, - TokenUrl = new Uri($"{authority.EnsureEndsWith('/')}connect/token") + TokenUrl = tokenUrl } } }); From e1505ab58e05206e7920c37ad66911ebe73c1a5d Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 20 Oct 2022 23:28:18 -0400 Subject: [PATCH 2/4] Fixed param order --- .../AbpSwaggerGenServiceCollectionExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs b/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs index ad350517804..3c27c640cdf 100644 --- a/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs +++ b/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs @@ -33,9 +33,9 @@ public static IServiceCollection AddAbpSwaggerGenWithOAuth( this IServiceCollection services, [NotNull] string authority, [NotNull] Dictionary scopes, + Action setupAction = null, string authorizationEndpoint = "/connect/authorize", - string tokenEndpoint = "/connect/token", - Action setupAction = null) + string tokenEndpoint = "/connect/token") { var authorizationUrl = new Uri($"{authority.TrimEnd('/')}{authorizationEndpoint.EnsureStartsWith('/')}"); var tokenUrl = new Uri($"{authority.TrimEnd('/')}{tokenEndpoint.EnsureStartsWith('/')}"); From 8070bd354cddd4c4508d4844b1fe364f53133a13 Mon Sep 17 00:00:00 2001 From: Salih Date: Sat, 22 Oct 2022 16:38:55 +0300 Subject: [PATCH 3/4] Update CLI.md --- docs/en/CLI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/CLI.md b/docs/en/CLI.md index 7a5e59a62ac..fab0b6d743f 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -144,7 +144,7 @@ For more samples, go to [ABP CLI Create Solution Samples](CLI-New-Command-Sample * `ef`: Entity Framework Core. * `mongodb`: MongoDB. * `--theme`: Specifes the theme. Default theme is `leptonx-lite`. Available themes: - * `leptonx-lite`: [LeptonX Lite Theme](/Themes/LeptonXLite/mvc.md). + * `leptonx-lite`: [LeptonX Lite Theme](/Themes/LeptonXLite/AspNetCore.md). * `basic`: [Basic Theme](/UI/AspNetCore/Basic-Theme.md). * **`maui`**: .NET MAUI. A minimalist .NET MAUI application will be created if you specify this option. * `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. From acb9e8c3d4d4b072808d5d394d249ff202de195d Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Sat, 22 Oct 2022 16:48:53 +0300 Subject: [PATCH 4/4] Update CLI.md --- docs/en/CLI.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/CLI.md b/docs/en/CLI.md index fab0b6d743f..0b580b6aa71 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -129,8 +129,8 @@ For more samples, go to [ABP CLI Create Solution Samples](CLI-New-Command-Sample * `ef`: Entity Framework Core. * `mongodb`: MongoDB. * `--theme`: Specifes the theme. Default theme is `leptonx-lite`. Available themes: - * `leptonx-lite`: [LeptonX Lite Theme](/Themes/LeptonXLite/mvc.md). - * `basic`: [Basic Theme](/UI/AspNetCore/Basic-Theme.md). + * `leptonx-lite`: [LeptonX Lite Theme](Themes/LeptonXLite/AspNetCore.md). + * `basic`: [Basic Theme](UI/AspNetCore/Basic-Theme.md). * **`module`**: [Module template](Startup-Templates/Module.md). Additional options: * `--no-ui`: Specifies to not include the UI. This makes possible to create service-only modules (a.k.a. microservices - without UI). * **`console`**: [Console template](Startup-Templates/Console.md). @@ -144,8 +144,8 @@ For more samples, go to [ABP CLI Create Solution Samples](CLI-New-Command-Sample * `ef`: Entity Framework Core. * `mongodb`: MongoDB. * `--theme`: Specifes the theme. Default theme is `leptonx-lite`. Available themes: - * `leptonx-lite`: [LeptonX Lite Theme](/Themes/LeptonXLite/AspNetCore.md). - * `basic`: [Basic Theme](/UI/AspNetCore/Basic-Theme.md). + * `leptonx-lite`: [LeptonX Lite Theme](Themes/LeptonXLite/AspNetCore.md). + * `basic`: [Basic Theme](UI/AspNetCore/Basic-Theme.md). * **`maui`**: .NET MAUI. A minimalist .NET MAUI application will be created if you specify this option. * `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. * `--version` or `-v`: Specifies the ABP & template version. It can be a [release tag](https://github.com/abpframework/abp/releases) or a [branch name](https://github.com/abpframework/abp/branches). Uses the latest release if not specified. Most of the times, you will want to use the latest version.