From 696b560a883aed88dc32cfecaae8002dd6ad1f26 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 6 Apr 2020 11:02:36 +0300 Subject: [PATCH 1/3] permission management tests: fix folder mismatch --- modules/permission-management/Volo.Abp.PermissionManagement.sln | 2 +- .../Volo.Abp.PermissionManagement.Domain.Tests.csproj | 0 .../PermissionManagement/AbpPermissionManagementTestModule.cs | 0 .../Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs | 0 .../Abp/PermissionManagement/PermissionChecker_User_Tests.cs | 0 .../Volo/Abp/PermissionManagement/PermissionDataSeeder_Tests.cs | 0 .../PermissionGrantCacheItemInvalidator_Tests.cs | 0 .../PermissionManagement/PermissionManagementProvider_Tests.cs | 0 .../Volo/Abp/PermissionManagement/PermissionManager_Tests.cs | 0 .../Volo/Abp/PermissionManagement/PermissionStore_Tests.cs | 0 .../Volo/Abp/PermissionManagement/PermissionTestBase.cs | 0 11 files changed, 1 insertion(+), 1 deletion(-) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo.Abp.PermissionManagement.Domain.Tests.csproj (100%) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs (100%) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo/Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs (100%) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo/Abp/PermissionManagement/PermissionChecker_User_Tests.cs (100%) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo/Abp/PermissionManagement/PermissionDataSeeder_Tests.cs (100%) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo/Abp/PermissionManagement/PermissionGrantCacheItemInvalidator_Tests.cs (100%) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs (100%) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo/Abp/PermissionManagement/PermissionManager_Tests.cs (100%) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo/Abp/PermissionManagement/PermissionStore_Tests.cs (100%) rename modules/permission-management/test/{Volo.Abp.PermissionManagement.Tests => Volo.Abp.PermissionManagement.Domain.Tests}/Volo/Abp/PermissionManagement/PermissionTestBase.cs (100%) diff --git a/modules/permission-management/Volo.Abp.PermissionManagement.sln b/modules/permission-management/Volo.Abp.PermissionManagement.sln index 16071f9e10..7206382e8e 100644 --- a/modules/permission-management/Volo.Abp.PermissionManagement.sln +++ b/modules/permission-management/Volo.Abp.PermissionManagement.sln @@ -19,7 +19,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.PermissionManageme EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.PermissionManagement.Web", "src\Volo.Abp.PermissionManagement.Web\Volo.Abp.PermissionManagement.Web.csproj", "{97A386F8-DAE0-4BEA-ADE5-1D57C3336515}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.PermissionManagement.Domain.Tests", "test\Volo.Abp.PermissionManagement.Tests\Volo.Abp.PermissionManagement.Domain.Tests.csproj", "{48297098-79D0-413B-939C-6C432142C42D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.PermissionManagement.Domain.Tests", "test\Volo.Abp.PermissionManagement.Domain.Tests\Volo.Abp.PermissionManagement.Domain.Tests.csproj", "{48297098-79D0-413B-939C-6C432142C42D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.PermissionManagement.TestBase", "test\Volo.Abp.PermissionManagement.TestBase\Volo.Abp.PermissionManagement.TestBase.csproj", "{49259427-CAEB-4FAE-81E4-848F789487EA}" EndProject diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo.Abp.PermissionManagement.Domain.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo.Abp.PermissionManagement.Domain.Tests.csproj similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo.Abp.PermissionManagement.Domain.Tests.csproj rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo.Abp.PermissionManagement.Domain.Tests.csproj diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionChecker_User_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionChecker_User_Tests.cs similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionChecker_User_Tests.cs rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionChecker_User_Tests.cs diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionDataSeeder_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionDataSeeder_Tests.cs similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionDataSeeder_Tests.cs rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionDataSeeder_Tests.cs diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionGrantCacheItemInvalidator_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionGrantCacheItemInvalidator_Tests.cs similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionGrantCacheItemInvalidator_Tests.cs rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionGrantCacheItemInvalidator_Tests.cs diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManager_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionManager_Tests.cs similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManager_Tests.cs rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionManager_Tests.cs diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionStore_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionStore_Tests.cs similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionStore_Tests.cs rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionStore_Tests.cs diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionTestBase.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionTestBase.cs similarity index 100% rename from modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionTestBase.cs rename to modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionTestBase.cs From 4798bc09616c5995baa1ae9be40a027927873571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 6 Apr 2020 11:21:37 +0300 Subject: [PATCH 2/3] Minor improvements for the how to guides. --- .../Azure-Active-Directory-Authentication-MVC.md | 16 ++++++++-------- docs/en/How-To/Customize-Login-Page-MVC.md | 2 +- docs/en/How-To/Customize-SignIn-Manager.md | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md index 6eb9c594c6..10b1e05a4a 100644 --- a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md +++ b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md @@ -12,7 +12,7 @@ Two different **alternative approaches** for AzureAD integration will be demonst > There is **no difference** in functionality between these approaches. AddAzureAD is an abstracted way of OpenIdConnection ([source](https://github.com/dotnet/aspnetcore/blob/c56aa320c32ee5429d60647782c91d53ac765865/src/Azure/AzureAD/Authentication.AzureAD.UI/src/AzureADAuthenticationBuilderExtensions.cs#L122)) with predefined cookie settings. > -> However there are key differences in integration to ABP applications because of defaultly configurated signin schemes which will be explained below. +> However there are key differences in integration to ABP applications because of default configurated signin schemes which will be explained below. ## 1. AddAzureAD @@ -22,7 +22,7 @@ If you choose this approach, you will need to install `Microsoft.AspNetCore.Auth #### **Updating `appsettings.json`** -You need to add a new section to your appsettings which will be binded to configuration when configuring the OpenIdConnectOptions: +You need to add a new section to your `appsettings.json` which will be binded to configuration when configuring the `OpenIdConnectOptions`: ````json "AzureAd": { @@ -36,7 +36,7 @@ You need to add a new section to your appsettings which will be binded to config > Important configuration here is the CallbackPath. This value must be the same with one of your Azure AD-> app registrations-> Authentication -> RedirectUri. -Then, you need to configure the OpenIdConnectOptions to complete the integration. +Then, you need to configure the `OpenIdConnectOptions` to complete the integration. #### Configuring OpenIdConnectOptions @@ -88,9 +88,9 @@ You are done and integration is completed. If you don't want to use an extra nuget package in your application, you can use the straight default [OpenIdConnect](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.OpenIdConnect/) which can be used for all OpenId connections including AzureAD external authentication. -You don't have to use appsettings configuration but it is a good practice to set AzureAD information in the appsettings. +You don't have to use `appsettings.json` configuration but it is a good practice to set AzureAD information in the `appsettings.json`. -To get the AzureAD information from appsettings, which will be used in OpenIdConnectOptions configuration, simply add a new section to appsettings.json located in your **.Web** project: +To get the AzureAD information from `appsettings.json`, which will be used in `OpenIdConnectOptions` configuration, simply add a new section to `appsettings.json` located in your **.Web** project: ````json "AzureAd": { @@ -132,7 +132,7 @@ private void ConfigureAuthentication(ServiceConfigurationContext context, IConfi } ```` -And thats it, integration is completed. Keep on mind that you can connect any other external authentication providers. +And that's it, integration is completed. Keep on mind that you can connect any other external authentication providers. ## The Source Code @@ -175,11 +175,11 @@ You can find the source code of the completed example [here](https://github.com/ * This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add - + ````csharp options.Scope.Add("email"); ```` - + to your openid configuration. * How can I **debug/watch** which claims I get before they get mapped? diff --git a/docs/en/How-To/Customize-Login-Page-MVC.md b/docs/en/How-To/Customize-Login-Page-MVC.md index 33261709bc..5678828bfb 100644 --- a/docs/en/How-To/Customize-Login-Page-MVC.md +++ b/docs/en/How-To/Customize-Login-Page-MVC.md @@ -1,6 +1,6 @@ # How to Customize the Login Page for MVC / Razor Page Applications -When you create a new application using the [application startup template](../Startup-Templates/Application.md), source code of the login page will not be inside your solution, so you can not directly change it. The login page comes from the [Account Module.md](../Modules/Account) that is used a [NuGet package](https://www.nuget.org/packages/Volo.Abp.Account.Web) reference. +When you create a new application using the [application startup template](../Startup-Templates/Application.md), source code of the login page will not be inside your solution, so you can not directly change it. The login page comes from the [Account Module](../Modules/Account.md) that is used a [NuGet package](https://www.nuget.org/packages/Volo.Abp.Account.Web) reference. This document explains how to customize the login page for your own application. diff --git a/docs/en/How-To/Customize-SignIn-Manager.md b/docs/en/How-To/Customize-SignIn-Manager.md index 510e8146aa..a0fa26b9b7 100644 --- a/docs/en/How-To/Customize-SignIn-Manager.md +++ b/docs/en/How-To/Customize-SignIn-Manager.md @@ -82,7 +82,7 @@ To get your overridden method invoked and your customized SignIn Manager class t Registering `CustomSignInManager` should be done with adding **AddSignInManager** extension method of the [IdentityBuilderExtensions](https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Core/src/IdentityBuilderExtensions.cs) of the [IdentityBuilder](https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Extensions.Core/src/IdentityBuilder.cs). -Inside your `.Web` project, locate the `ApplicationNameWebModule` and add the following under `ConfigureServices` method to replace the old SignInManager with your customized one. +Inside your `.Web` project, locate the `ApplicationNameWebModule` and add the following under `ConfigureServices` method to replace the old `SignInManager` with your customized one. ````csharp context.Services From 577396186b0c5b1d300303158d4884ae673db7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 6 Apr 2020 11:28:35 +0300 Subject: [PATCH 3/3] Update Customize-SignIn-Manager.md --- docs/en/How-To/Customize-SignIn-Manager.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/en/How-To/Customize-SignIn-Manager.md b/docs/en/How-To/Customize-SignIn-Manager.md index a0fa26b9b7..61b6c3b7b5 100644 --- a/docs/en/How-To/Customize-SignIn-Manager.md +++ b/docs/en/How-To/Customize-SignIn-Manager.md @@ -82,12 +82,13 @@ To get your overridden method invoked and your customized SignIn Manager class t Registering `CustomSignInManager` should be done with adding **AddSignInManager** extension method of the [IdentityBuilderExtensions](https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Core/src/IdentityBuilderExtensions.cs) of the [IdentityBuilder](https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Extensions.Core/src/IdentityBuilder.cs). -Inside your `.Web` project, locate the `ApplicationNameWebModule` and add the following under `ConfigureServices` method to replace the old `SignInManager` with your customized one. +Inside your `.Web` project, locate the `YourProjectNameWebModule` and add the following code under the `PreConfigureServices` method to replace the old `SignInManager` with your customized one: ````csharp -context.Services -.GetObject() - .AddSignInManager(); +PreConfigure(identityBuilder => +{ + identityBuilder.AddSignInManager(); +}); ```` ## The Source Code