diff --git a/TheIdServer.sln b/TheIdServer.sln index 5fedfe740..3aa37be30 100644 --- a/TheIdServer.sln +++ b/TheIdServer.sln @@ -71,7 +71,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aguacongas.TheIdServer.Auth EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aguacongas.TheIdServer.Authentication.IntegrationTest", "test\Aguacongas.TheIdServer.Authentication..Integration.Test\Aguacongas.TheIdServer.Authentication.IntegrationTest.csproj", "{7F9CAFD6-D361-4CB8-A6E1-7F1D0BEE4AEB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aguacongas.TheIdServer.Test", "test\Aguacongas.TheIdServer.Test\Aguacongas.TheIdServer.Test.csproj", "{34B6748E-64C1-46A3-AABE-56E215204542}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aguacongas.TheIdServer.Test", "test\Aguacongas.TheIdServer.Test\Aguacongas.TheIdServer.Test.csproj", "{34B6748E-64C1-46A3-AABE-56E215204542}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlazorApp", "BlazorApp", "{8A3B91E5-02A3-42F0-B2E7-E419B5086FFA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aguacongas.TheIdServer.BlazorApp.Infrastructure", "src\BlazorApp\Aguacongas.TheIdServer.BlazorApp.Infrastructure\Aguacongas.TheIdServer.BlazorApp.Infrastructure.csproj", "{C2806393-D1EB-4DDE-8A4B-AA65014B8D08}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aguacongas.TheIdServer.BlazorApp.Components", "src\BlazorApp\Aguacongas.TheIdServer.BlazorApp.Components\Aguacongas.TheIdServer.BlazorApp.Components.csproj", "{54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aguacongas.TheIdServer.BlazorApp.Pages", "src\BlazorApp\Aguacongas.TheIdServer.BlazorApp.Pages\Aguacongas.TheIdServer.BlazorApp.Pages.csproj", "{665F5796-7F54-44D7-8976-9ADA169353F1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -443,6 +451,42 @@ Global {34B6748E-64C1-46A3-AABE-56E215204542}.Release|x64.Build.0 = Release|Any CPU {34B6748E-64C1-46A3-AABE-56E215204542}.Release|x86.ActiveCfg = Release|Any CPU {34B6748E-64C1-46A3-AABE-56E215204542}.Release|x86.Build.0 = Release|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Debug|x64.ActiveCfg = Debug|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Debug|x64.Build.0 = Debug|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Debug|x86.ActiveCfg = Debug|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Debug|x86.Build.0 = Debug|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Release|Any CPU.Build.0 = Release|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Release|x64.ActiveCfg = Release|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Release|x64.Build.0 = Release|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Release|x86.ActiveCfg = Release|Any CPU + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08}.Release|x86.Build.0 = Release|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Debug|x64.ActiveCfg = Debug|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Debug|x64.Build.0 = Debug|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Debug|x86.ActiveCfg = Debug|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Debug|x86.Build.0 = Debug|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Release|Any CPU.Build.0 = Release|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Release|x64.ActiveCfg = Release|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Release|x64.Build.0 = Release|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Release|x86.ActiveCfg = Release|Any CPU + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA}.Release|x86.Build.0 = Release|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Debug|x64.ActiveCfg = Debug|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Debug|x64.Build.0 = Debug|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Debug|x86.ActiveCfg = Debug|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Debug|x86.Build.0 = Debug|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Release|Any CPU.Build.0 = Release|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Release|x64.ActiveCfg = Release|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Release|x64.Build.0 = Release|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Release|x86.ActiveCfg = Release|Any CPU + {665F5796-7F54-44D7-8976-9ADA169353F1}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -480,6 +524,10 @@ Global {9F64CDFF-6347-4F62-B74F-C6CA2743E667} = {DF545B54-78FB-42D0-A842-A1490A579B37} {7F9CAFD6-D361-4CB8-A6E1-7F1D0BEE4AEB} = {DE50F426-4409-4573-8502-93364ED12E0C} {34B6748E-64C1-46A3-AABE-56E215204542} = {DE50F426-4409-4573-8502-93364ED12E0C} + {8A3B91E5-02A3-42F0-B2E7-E419B5086FFA} = {DF545B54-78FB-42D0-A842-A1490A579B37} + {C2806393-D1EB-4DDE-8A4B-AA65014B8D08} = {8A3B91E5-02A3-42F0-B2E7-E419B5086FFA} + {54A378B8-9BA4-4082-A044-2A8DEA7DEAEA} = {8A3B91E5-02A3-42F0-B2E7-E419B5086FFA} + {665F5796-7F54-44D7-8976-9ADA169353F1} = {8A3B91E5-02A3-42F0-B2E7-E419B5086FFA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5283BE0B-F6F2-4458-B12F-64C78CFF8CBA} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Aguacongas.TheIdServer.BlazorApp.csproj b/src/Aguacongas.TheIdServer.BlazorApp/Aguacongas.TheIdServer.BlazorApp.csproj index 15d9d4499..36d9222fe 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Aguacongas.TheIdServer.BlazorApp.csproj +++ b/src/Aguacongas.TheIdServer.BlazorApp/Aguacongas.TheIdServer.BlazorApp.csproj @@ -8,8 +8,8 @@ https://github.com/Aguafrommars/TheIdServer/tree/master/src/Aguacongas.TheIdServer.BlazorApp https://github.com/Aguafrommars/TheIdServer git - theidserver;identity - Identity stores implementation for TheIdServer API. + theidserver;identityserver4;oidc;oauth;identity,authentication;security + TheIdServer administration application. Full 3.0 @@ -20,6 +20,7 @@ Aguacongas.TheIdServer.BlazorApp.ruleset + 1701;1702 @@ -29,8 +30,6 @@ - - @@ -41,6 +40,6 @@ - + diff --git a/src/Aguacongas.TheIdServer.BlazorApp/App.razor b/src/Aguacongas.TheIdServer.BlazorApp/App.razor index f57f4b4fd..a68fa7b9b 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/App.razor +++ b/src/Aguacongas.TheIdServer.BlazorApp/App.razor @@ -1,4 +1,5 @@ - + diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/Settings.cs b/src/Aguacongas.TheIdServer.BlazorApp/Models/Settings.cs deleted file mode 100644 index 4bc81fb19..000000000 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/Settings.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Aguacongas.TheIdServer.BlazorApp.Models -{ - public class Settings - { - public string ApiBaseUrl { get; set; } - - public string AdministratorEmail { get; set; } - public string WelcomeContenUrl { get; set; } - } -} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Program.cs b/src/Aguacongas.TheIdServer.BlazorApp/Program.cs index afa18028c..eaaeb171d 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Program.cs +++ b/src/Aguacongas.TheIdServer.BlazorApp/Program.cs @@ -1,15 +1,5 @@ -using Aguacongas.AspNetCore.Authentication; -using Aguacongas.IdentityServer.Store; -using Aguacongas.TheIdServer.BlazorApp.Models; -using Aguacongas.TheIdServer.BlazorApp.Services; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components.WebAssembly.Authentication; -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using System; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using System.Diagnostics.CodeAnalysis; -using System.Net.Http; using System.Threading.Tasks; namespace Aguacongas.TheIdServer.BlazorApp @@ -19,56 +9,11 @@ public class Program { public static async Task Main(string[] args) { - var builder = WebAssemblyHostBuilder.CreateDefault(args); - builder.RootComponents.Add("app"); - ConfigureServices(builder.Services, builder.Configuration, builder.HostEnvironment.BaseAddress); + var builder = WebAssemblyHostBuilder.CreateDefault(args); + builder.RootComponents.Add("app"); + builder.AddTheIdServerApp(); await builder.Build().RunAsync(); - } - - public static void ConfigureServices(IServiceCollection services, IConfiguration configuration, string baseAddress) - { - var settings = configuration.Get(); - services - .AddOptions() - .AddOidcAuthentication(options => - { - configuration.GetSection("AuthenticationPaths").Bind(options.AuthenticationPaths); - configuration.GetSection("UserOptions").Bind(options.UserOptions); - configuration.Bind("ProviderOptions", options.ProviderOptions); - }) - .AddAccountClaimsPrincipalFactory(); - - services.AddAuthorizationCore(options => - { - options.AddIdentityServerPolicies(); - }); - - - services - .AddIdentityServer4AdminHttpStores(p => - { - return Task.FromResult(CreateApiHttpClient(p, settings)); - }) - .AddSingleton(new HttpClient { BaseAddress = new Uri(baseAddress) }) - .AddSingleton(p => settings) - .AddSingleton() - .AddSingleton() - .AddTransient, UserAdminStore>() - .AddTransient, RoleAdminStore>() - .AddTransient, ExternalProviderStore>() - .AddHttpClient("oidc") - .AddHttpMessageHandler(); - } - - private static HttpClient CreateApiHttpClient(IServiceProvider p, Settings settings) - { - var httpClient = p.GetRequiredService() - .CreateClient("oidc"); - - var apiUri = new Uri(settings.ApiBaseUrl); - httpClient.BaseAddress = apiUri; - return httpClient; - } + } } } diff --git a/src/Aguacongas.TheIdServer.BlazorApp/README.md b/src/Aguacongas.TheIdServer.BlazorApp/README.md index 06e621dee..2fe67f6d9 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/README.md +++ b/src/Aguacongas.TheIdServer.BlazorApp/README.md @@ -2,6 +2,8 @@ This project contains the code of the [Blazor wasm](https//blazor.net) application to manage an [IdentityServer4](https://identityserver4.readthedocs.io/en/latest/) +## Instalation + ### From Docker The application is embeded in the [server's Linux image](../Aguacongas.TheIdServer/README.md#from-docker). @@ -16,6 +18,14 @@ Unzip in the destination of your choice, and use the server of your choice. Read [Host and deploy ASP.NET Core Blazor WebAssembly](https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/blazor/webassembly?view=aspnetcore-3.1) for more information. +### From Nuget packages + +Nuget packages composing the application are available on [nuget.org](https://www.nuget.org/): + +* **Aguacongas.TheIdServer.BlazorApp.Infrastructure** contains application models, services, validators and extensions +* **Aguacongas.TheIdServer.BlazorApp.Components** contains application components +* **Aguacongas.TheIdServer.BlazorApp.Pages** contains application pages + ## Configuration The application reads its configuration from *appsettings.json* and environment specific configuration data from *appsettings.{environment}.json* @@ -30,6 +40,19 @@ The application reads its configuration from *appsettings.json* and environment "remoteRegisterPath": "/identity/account/register", "remoteProfilePath": "/identity/account/manage" }, + "loggingOptions": { + "minimum": "Debug", + "filters": [ + { + "category": "System", + "level": "Warning" + }, + { + "category": "Microsoft", + "level": "Information" + } + ] + }, "userOptions": { "roleClaim": "role" }, @@ -66,6 +89,18 @@ The application doesn't contain pages to register a new user or manage the curre For more informations read [ASP.NET Core Blazor WebAssembly additional security scenarios / Customize app routes](https://docs.microsoft.com/en-us/aspnet/core/security/blazor/webassembly/additional-scenarios?view=aspnetcore-3.1#customize-app-routes). +### loggingOptions + +Defines logging options. + +#### minimum + +Defines the [log minimum level](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-3.1). + +#### filters + +Each item in this array add a log filter by category and [LogLevel](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-3.1) + ### userOptions The section **userOptions** is binded to the class `Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationUserOptions`. @@ -119,4 +154,5 @@ This endpoint should return an html fragment code. * [ASP.NET Core Blazor hosting model configuration](https://docs.microsoft.com/en-us/aspnet/core/blazor/hosting-model-configuration?view=aspnetcore-3.1#configuration) * [ASP.NET Core Blazor WebAssembly additional security scenarios](https://docs.microsoft.com/en-us/aspnet/core/security/blazor/webassembly/additional-scenarios?view=aspnetcore-3.1#customize-app-routes) -* [Secure an ASP.NET Core Blazor WebAssembly standalone app with the Authentication library](https://docs.microsoft.com/en-us/aspnet/core/security/blazor/webassembly/standalone-with-authentication-library?view=aspnetcore-3.1#authentication-service-support) \ No newline at end of file +* [Secure an ASP.NET Core Blazor WebAssembly standalone app with the Authentication library](https://docs.microsoft.com/en-us/aspnet/core/security/blazor/webassembly/standalone-with-authentication-library?view=aspnetcore-3.1#authentication-service-support) +* [LogLevel Enum](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-3.1) \ No newline at end of file diff --git a/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.Development.json b/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.Development.json index 6d452170d..820bc9571 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.Development.json +++ b/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.Development.json @@ -1,4 +1,17 @@ { + "loggingOptions": { + "minimum": "Debug", + "filters": [ + { + "category": "System", + "level": "Warning" + }, + { + "category": "Microsoft", + "level": "Information" + } + ] + }, "providerOptions": { "postLogoutRedirectUri": "https://localhost:5443/authentication/logout-callback", "redirectUri": "https://localhost:5443/authentication/login-callback" diff --git a/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.json b/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.json index d4dbd78cd..c6d0e53db 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.json +++ b/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.json @@ -1,6 +1,9 @@ { "administratorEmail": "aguacongas@gmail.com", "apiBaseUrl": "https://localhost:5443/api", + "loggingOptions": { + "minimum": "Warning" + }, "authenticationPaths": { "remoteRegisterPath": "/identity/account/register", "remoteProfilePath": "/identity/account/manage" diff --git a/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/index.html b/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/index.html index aec385667..bd3807cce 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/index.html +++ b/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/index.html @@ -13,7 +13,7 @@ Loading... - + diff --git a/src/Aguacongas.TheIdServer/Aguacongas.TheIdServer.csproj b/src/Aguacongas.TheIdServer/Aguacongas.TheIdServer.csproj index 9c21b20e3..87c7deb93 100644 --- a/src/Aguacongas.TheIdServer/Aguacongas.TheIdServer.csproj +++ b/src/Aguacongas.TheIdServer/Aguacongas.TheIdServer.csproj @@ -8,7 +8,7 @@ https://github.com/Aguafrommars/TheIdServer/tree/master/src/Aguacongas.TheIdServer https://github.com/Aguafrommars/TheIdServer git - aspnetcore;oidc,oauth;authentication;security + aspnetcore;identityserver4;oidc,oauth;authentication;security OpenID/Connect server base on IdentityServer4. Full f6987681-1871-440a-a6ea-a606c2c5ccf6 diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Aguacongas.TheIdServer.BlazorApp.Components.csproj b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Aguacongas.TheIdServer.BlazorApp.Components.csproj new file mode 100644 index 000000000..245c273d3 --- /dev/null +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Aguacongas.TheIdServer.BlazorApp.Components.csproj @@ -0,0 +1,26 @@ + + + + netstandard2.1 + Olivier Lefebvre + Copyright (c) 2020 @Olivier Lefebvre + https://raw.githubusercontent.com/Aguafrommars/TheIdServer/master/LICENSE + https://github.com/Aguafrommars/TheIdServer/tree/master/src/Aguacongas.TheIdServer.BlazorApp + https://github.com/Aguafrommars/TheIdServer + git + theidserver;identityserver4;oidc;oauth;identity,authentication;security + TheIdServer administration application components. + Full + 3.0 + + + + + + + + + + + + diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiClaimTypes.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiClaimTypes.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiClaimTypes.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiClaimTypes.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiClaimTypes.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiClaimTypes.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiClaimTypes.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiClaimTypes.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiProperties.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiProperties.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiProperties.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiProperties.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiScope.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiScope.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiScope.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiScope.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiScope.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiScope.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiScope.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiScope.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiScopeClaimTypes.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiScopeClaimTypes.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiScopeClaimTypes.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiScopeClaimTypes.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiScopeClaimTypes.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiScopeClaimTypes.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiScopeClaimTypes.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiScopeClaimTypes.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiSecrets.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiSecrets.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ApiComponents/ApiSecrets.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ApiComponents/ApiSecrets.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/AuthorizedToken.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/AuthorizedToken.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/AuthorizedToken.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/AuthorizedToken.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/AuthorizedToken.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/AuthorizedToken.razor.cs similarity index 99% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/AuthorizedToken.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/AuthorizedToken.razor.cs index 61a3221f3..8abe17c70 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/AuthorizedToken.razor.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/AuthorizedToken.razor.cs @@ -112,9 +112,9 @@ private void SetValue(TimeSpan? time) { var timeValue = time.Value; var type = typeof(T); - if (type.IsGenericType) - { - type = type.GetGenericArguments()[0]; + if (type.IsGenericType) + { + type = type.GetGenericArguments()[0]; } Value = (T)Convert.ChangeType(timeValue.TotalSeconds, type); ValueChanged.InvokeAsync(Value); diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/AutoCompleteModel.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/AutoCompleteModel.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/AutoCompleteModel.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/AutoCompleteModel.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClaimType.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClaimType.razor similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClaimType.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClaimType.razor index 0f1f96338..b9171df1c 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClaimType.razor +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClaimType.razor @@ -1,31 +1,31 @@ -@inherits AutoCompleteModel -@inject IAdminStore _store - -@if (IsReadOnly) -{ -
-
@Entity.Type
-
- -
-
-} -else -{ -
- -
- -
-
- -} +@inherits AutoCompleteModel +@inject IAdminStore _store + +@if (IsReadOnly) +{ +
+
@Entity.Type
+
+ +
+
+} +else +{ +
+ +
+ +
+
+ +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClaimType.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClaimType.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClaimType.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClaimType.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientClaims.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientClaims.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientClaims.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientClaims.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientClaims.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientClaims.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientClaims.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientClaims.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientConsents.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientConsents.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientConsents.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientConsents.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientConsents.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientConsents.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientConsents.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientConsents.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientGrantTypes.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientGrantTypes.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientGrantTypes.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientGrantTypes.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientGrantTypes.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientGrantTypes.razor.cs similarity index 99% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientGrantTypes.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientGrantTypes.razor.cs index 541c5603e..9f60f67e6 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientGrantTypes.razor.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientGrantTypes.razor.cs @@ -21,9 +21,9 @@ private void OnGrantTypeDeletedClicked(Entity.ClientGrantType grantType) private void OnGrantTypeValueChanged(Entity.ClientGrantType grantType) { Model.AllowedGrantTypes.Add(new Entity.ClientGrantType()); - if (grantType.GrantType == "implicit") - { - Model.AllowAccessTokensViaBrowser = true; + if (grantType.GrantType == "implicit") + { + Model.AllowAccessTokensViaBrowser = true; } HandleModificationState.EntityCreated(grantType); } diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientIdpRestrictions.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientIdpRestrictions.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientIdpRestrictions.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientIdpRestrictions.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientIdpRestrictions.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientIdpRestrictions.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientIdpRestrictions.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientIdpRestrictions.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientProperties.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientProperties.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientProperties.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientProperties.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientScope.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientScope.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientScope.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientScope.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientScope.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientScope.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientScope.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientScope.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientSecrets.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientSecrets.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientSecrets.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientSecrets.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientTokens.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientTokens.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientTokens.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientTokens.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientTokens.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientTokens.razor.cs similarity index 91% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientTokens.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientTokens.razor.cs index 9724fbf61..8b5c65e54 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientTokens.razor.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientTokens.razor.cs @@ -3,12 +3,15 @@ using Microsoft.AspNetCore.Components; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using Entity = Aguacongas.IdentityServer.Store.Entity; namespace Aguacongas.TheIdServer.BlazorApp.Components.ClientComponents { public partial class ClientTokens { + [SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Used in component")] + [SuppressMessage("Major", "CS0169:Fiel is never asign to", Justification = "Used in component.")] private bool _showAllOptions; private readonly Dictionary _accessTokenQuickValues = new Dictionary diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientUris.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientUris.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientUris.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientUris.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientUris.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientUris.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/ClientUris.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/ClientUris.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/GrantType.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/GrantType.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/GrantType.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/GrantType.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/GrantType.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/GrantType.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/GrantType.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/GrantType.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/IdentityProvider.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/IdentityProvider.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/IdentityProvider.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/IdentityProvider.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/IdentityProvider.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/IdentityProvider.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ClientComponents/IdentityProvider.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ClientComponents/IdentityProvider.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/DeleteEntityButton.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/DeleteEntityButton.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/DeleteEntityButton.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/DeleteEntityButton.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/DeleteEntityButton.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/DeleteEntityButton.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/DeleteEntityButton.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/DeleteEntityButton.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/EntitesGridModel.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitesGridModel.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/EntitesGridModel.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitesGridModel.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/EntitiesGrid.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitiesGrid.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/EntitiesGrid.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitiesGrid.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/EntitiesGrid.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitiesGrid.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/EntitiesGrid.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitiesGrid.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/EntitySubGridTitle.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitySubGridTitle.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/EntitySubGridTitle.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitySubGridTitle.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/EntitySubGridTitle.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitySubGridTitle.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/EntitySubGridTitle.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/EntitySubGridTitle.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/FacebookOptionsComponent.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/FacebookOptionsComponent.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/FacebookOptionsComponent.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/FacebookOptionsComponent.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/GoogleOptionsComponent.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/GoogleOptionsComponent.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/GoogleOptionsComponent.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/GoogleOptionsComponent.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/MicrosoftAccountOptionsComponent.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/MicrosoftAccountOptionsComponent.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/MicrosoftAccountOptionsComponent.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/MicrosoftAccountOptionsComponent.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/OAuthOptionsComponent.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/OAuthOptionsComponent.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/OAuthOptionsComponent.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/OAuthOptionsComponent.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/OAuthOptionsProperties.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/OAuthOptionsProperties.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/OAuthOptionsProperties.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/OAuthOptionsProperties.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/OAuthOptionsProperties.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/OAuthOptionsProperties.razor.cs similarity index 96% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/OAuthOptionsProperties.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/OAuthOptionsProperties.razor.cs index 048002a07..d735d5dca 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/OAuthOptionsProperties.razor.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/OAuthOptionsProperties.razor.cs @@ -1,18 +1,18 @@ -using Aguacongas.TheIdServer.BlazorApp.Models; -using Microsoft.AspNetCore.Components; -using System.Collections.Generic; - -namespace Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents -{ - public partial class OAuthOptionsProperties - { - [Parameter] - public OAuthOptions Options { get; set; } - - protected override void OnInitialized() - { - Options.Scope = Options.Scope ?? new List(); - base.OnInitialized(); - } - } -} +using Aguacongas.TheIdServer.BlazorApp.Models; +using Microsoft.AspNetCore.Components; +using System.Collections.Generic; + +namespace Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents +{ + public partial class OAuthOptionsProperties + { + [Parameter] + public OAuthOptions Options { get; set; } + + protected override void OnInitialized() + { + Options.Scope = Options.Scope ?? new List(); + base.OnInitialized(); + } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/OpenIdConnectOptionsComponent.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/OpenIdConnectOptionsComponent.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/OpenIdConnectOptionsComponent.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/OpenIdConnectOptionsComponent.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ProviderOptionsBase.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ProviderOptionsBase.cs similarity index 96% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ProviderOptionsBase.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ProviderOptionsBase.cs index ecdc633a1..919b37eeb 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ProviderOptionsBase.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ProviderOptionsBase.cs @@ -1,32 +1,32 @@ -using Aguacongas.TheIdServer.BlazorApp.Models; -using Microsoft.AspNetCore.Components; -using System.Text.Json; - -namespace Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents -{ - public abstract class ProviderOptionsBase : ComponentBase - { - public abstract string SerializeOptions(); - } - - public abstract class ProviderOptionsBase : ProviderOptionsBase where T: RemoteAuthenticationOptions - { - protected T Options => Model.Options as T; - - [CascadingParameter] - public ExternalProvider Model { get; set; } - - protected override void OnInitialized() - { - Model.Options = Model.Options as T ?? Model.DefaultOptions as T; - base.OnInitialized(); - } - - - public override string SerializeOptions() - { - return JsonSerializer.Serialize(Options); - } - - } -} +using Aguacongas.TheIdServer.BlazorApp.Models; +using Microsoft.AspNetCore.Components; +using System.Text.Json; + +namespace Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents +{ + public abstract class ProviderOptionsBase : ComponentBase + { + public abstract string SerializeOptions(); + } + + public abstract class ProviderOptionsBase : ProviderOptionsBase where T: RemoteAuthenticationOptions + { + protected T Options => Model.Options as T; + + [CascadingParameter] + public ExternalProvider Model { get; set; } + + protected override void OnInitialized() + { + Model.Options = Model.Options as T ?? Model.DefaultOptions as T; + base.OnInitialized(); + } + + + public override string SerializeOptions() + { + return JsonSerializer.Serialize(Options); + } + + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ProviderSelect.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ProviderSelect.razor similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ProviderSelect.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ProviderSelect.razor index 924f10b90..78c8baa9b 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ProviderSelect.razor +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ProviderSelect.razor @@ -1,26 +1,26 @@ -@inject IExternalProviderKindStore _store -@inherits InputSelect - - - - - @if (Kinds == null) - { - loading... - } - else - { - - @foreach (var provider in Kinds) - { - - } - } - - - -
- @Value -
-
+@inject IExternalProviderKindStore _store +@inherits InputSelect + + + + + @if (Kinds == null) + { + loading... + } + else + { + + @foreach (var provider in Kinds) + { + + } + } + + + +
+ @Value +
+
\ No newline at end of file diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ProviderSelect.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ProviderSelect.razor.cs similarity index 96% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ProviderSelect.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ProviderSelect.razor.cs index 4c8f85d26..7e7c4594a 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ProviderSelect.razor.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ProviderSelect.razor.cs @@ -1,15 +1,15 @@ -using Aguacongas.IdentityServer.Store.Entity; -using Microsoft.AspNetCore.Components; -using System.Collections.Generic; - -namespace Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents -{ - public partial class ProviderSelect - { - [Parameter] - public string Id { get; set; } - - [Parameter] - public IEnumerable Kinds { get; set; } - } -} +using Aguacongas.IdentityServer.Store.Entity; +using Microsoft.AspNetCore.Components; +using System.Collections.Generic; + +namespace Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents +{ + public partial class ProviderSelect + { + [Parameter] + public string Id { get; set; } + + [Parameter] + public IEnumerable Kinds { get; set; } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ScopeCollection.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ScopeCollection.razor similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ScopeCollection.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ScopeCollection.razor index 06ae3224c..cc51774ee 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ScopeCollection.razor +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ScopeCollection.razor @@ -1,22 +1,22 @@ -
    - @foreach (var item in Collection) - { -
  • -
    -
    @item
    -
    - -
    -
    -
  • - } -
  • -
    - -
    - -
    -
    -
  • +
      + @foreach (var item in Collection) + { +
    • +
      +
      @item
      +
      + +
      +
      +
    • + } +
    • +
      + +
      + +
      +
      +
    \ No newline at end of file diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ScopeCollection.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ScopeCollection.razor.cs similarity index 95% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ScopeCollection.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ScopeCollection.razor.cs index 41724f91e..cda0a12c1 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/ScopeCollection.razor.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/ScopeCollection.razor.cs @@ -1,45 +1,45 @@ -using Microsoft.AspNetCore.Components; -using System.Collections.Generic; - -namespace Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents -{ - public partial class ScopeCollection - { - private string _value; - - [Parameter] - public string Id { get; set; } - - [Parameter] - public string Placeholder { get; set; } - - [Parameter] - public ICollection Collection { get; set; } - - private void OnDelete(string item) - { - Collection.Remove(item); - } - - private void OnInput(ChangeEventArgs e) - { - _value = e.Value as string; - } - - private void OnInputChanged(ChangeEventArgs e) - { - OnInput(e); - AddValue(); - } - - private void AddValue() - { - if (_value == null) - { - return; - } - Collection.Add(_value); - _value = null; - } - } -} +using Microsoft.AspNetCore.Components; +using System.Collections.Generic; + +namespace Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents +{ + public partial class ScopeCollection + { + private string _value; + + [Parameter] + public string Id { get; set; } + + [Parameter] + public string Placeholder { get; set; } + + [Parameter] + public ICollection Collection { get; set; } + + private void OnDelete(string item) + { + Collection.Remove(item); + } + + private void OnInput(ChangeEventArgs e) + { + _value = e.Value as string; + } + + private void OnInputChanged(ChangeEventArgs e) + { + OnInput(e); + AddValue(); + } + + private void AddValue() + { + if (_value == null) + { + return; + } + Collection.Add(_value); + _value = null; + } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/TwitterOptionsComponent.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/TwitterOptionsComponent.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ExternalProviderComponents/TwitterOptionsComponent.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ExternalProviderComponents/TwitterOptionsComponent.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Filter.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Filter.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Filter.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Filter.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Filter.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Filter.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Filter.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Filter.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeButton.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeButton.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeButton.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeButton.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeButton.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeButton.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeButton.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeButton.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeCheckbox.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeCheckbox.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeCheckbox.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeCheckbox.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeCheckbox.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeCheckbox.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeCheckbox.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeCheckbox.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeDate.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeDate.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeDate.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeDate.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeDate.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeDate.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeDate.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeDate.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeDropDownButton.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeDropDownButton.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeDropDownButton.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeDropDownButton.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeDropDownButton.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeDropDownButton.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeDropDownButton.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeDropDownButton.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeText.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeText.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeText.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeText.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeText.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeText.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeText.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeText.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeTextArea.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeTextArea.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeTextArea.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeTextArea.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeTextArea.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeTextArea.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/AuthorizeTextArea.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/AuthorizeTextArea.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Form/FluentValidationValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/FluentValidationValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Form/FluentValidationValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Form/FluentValidationValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/IdentityComponents/IdentityClaimTypes.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/IdentityComponents/IdentityClaimTypes.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/IdentityComponents/IdentityClaimTypes.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/IdentityComponents/IdentityClaimTypes.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/IdentityComponents/IdentityClaimTypes.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/IdentityComponents/IdentityClaimTypes.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/IdentityComponents/IdentityClaimTypes.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/IdentityComponents/IdentityClaimTypes.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/IdentityComponents/IdentityProperties.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/IdentityComponents/IdentityProperties.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/IdentityComponents/IdentityProperties.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/IdentityComponents/IdentityProperties.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/LoginDisplay.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/LoginDisplay.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/LoginDisplay.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/LoginDisplay.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/LoginDisplay.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/LoginDisplay.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/LoginDisplay.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/LoginDisplay.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/PageListHeader.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/PageListHeader.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/PageListHeader.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/PageListHeader.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/PageListHeader.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/PageListHeader.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/PageListHeader.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/PageListHeader.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/ReferenceToken.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ReferenceToken.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/ReferenceToken.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ReferenceToken.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/RefreshToken.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/RefreshToken.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/RefreshToken.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/RefreshToken.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/SortableHeader.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/SortableHeader.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/SortableHeader.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/SortableHeader.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/SortableHeader.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/SortableHeader.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/SortableHeader.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/SortableHeader.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Toast.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Toast.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Toast.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Toast.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Toast.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Toast.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Toast.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Toast.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Toaster.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Toaster.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Toaster.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Toaster.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/Toaster.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Toaster.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/Toaster.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/Toaster.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/TokensGrid.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/TokensGrid.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/TokensGrid.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/TokensGrid.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/TokensGrid.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/TokensGrid.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/TokensGrid.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/TokensGrid.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserConsents.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserConsents.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserConsents.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserConsents.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserConsents.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserConsents.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserConsents.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserConsents.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserLogins.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserLogins.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserLogins.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserLogins.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserRole.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserRole.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserRole.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserRole.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserRole.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserRole.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserRole.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserRole.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserRoles.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserRoles.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserRoles.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserRoles.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserRoles.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserRoles.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserRoles.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserRoles.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserTokens.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserTokens.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Components/UserComponents/UserTokens.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/UserComponents/UserTokens.razor diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/_Imports.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/_Imports.razor new file mode 100644 index 000000000..88c08b30b --- /dev/null +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/_Imports.razor @@ -0,0 +1,15 @@ +@using System.Net.Http +@using Microsoft.AspNetCore.Components.Authorization +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Identity +@using Microsoft.JSInterop +@using Aguacongas.IdentityServer.Store +@using Aguacongas.TheIdServer.BlazorApp +@using Aguacongas.TheIdServer.BlazorApp.Components +@using Aguacongas.TheIdServer.BlazorApp.Components.Form +@using Aguacongas.TheIdServer.BlazorApp.Extensions +@using Aguacongas.TheIdServer.BlazorApp.Models +@using Aguacongas.TheIdServer.BlazorApp.Services +@using Entity = Aguacongas.IdentityServer.Store.Entity diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Aguacongas.TheIdServer.BlazorApp.Infrastructure.csproj b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Aguacongas.TheIdServer.BlazorApp.Infrastructure.csproj new file mode 100644 index 000000000..c08f0c131 --- /dev/null +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Aguacongas.TheIdServer.BlazorApp.Infrastructure.csproj @@ -0,0 +1,30 @@ + + + + netstandard2.1 + Olivier Lefebvre + Copyright (c) 2020 @Olivier Lefebvre + https://raw.githubusercontent.com/Aguafrommars/TheIdServer/master/LICENSE + https://github.com/Aguafrommars/TheIdServer/tree/master/src/Aguacongas.TheIdServer.BlazorApp + https://github.com/Aguafrommars/TheIdServer + git + theidserver;identityserver4;oidc;oauth;identity,authentication;security + TheIdServer administration application models, services, validators and extensions. + Full + 3.0 + + + + + + + + + + + + + + + + diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Extensions/AuthorizationOptionsExtensions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/AuthorizationOptionsExtensions.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Extensions/AuthorizationOptionsExtensions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/AuthorizationOptionsExtensions.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Extensions/ClientExtensions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/ClientExtensions.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Extensions/ClientExtensions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/ClientExtensions.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Extensions/EditContextExtensions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/EditContextExtensions.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Extensions/EditContextExtensions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/EditContextExtensions.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Extensions/RuleBuilderExentsions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/RuleBuilderExentsions.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Extensions/RuleBuilderExentsions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/RuleBuilderExentsions.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Extensions/StringExtensions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/StringExtensions.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Extensions/StringExtensions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/StringExtensions.cs diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/WebAssemblyHostBuilderExtensions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/WebAssemblyHostBuilderExtensions.cs new file mode 100644 index 000000000..a4b5f6d13 --- /dev/null +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Extensions/WebAssemblyHostBuilderExtensions.cs @@ -0,0 +1,86 @@ +using Aguacongas.AspNetCore.Authentication; +using Aguacongas.IdentityServer.Store; +using Aguacongas.TheIdServer.BlazorApp.Models; +using Aguacongas.TheIdServer.BlazorApp.Services; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.WebAssembly.Authentication; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using System; +using System.Net.Http; +using System.Threading.Tasks; + +namespace Microsoft.AspNetCore.Components.WebAssembly.Hosting +{ + public static class WebAssemblyHostBuilderExtensions + { + public static WebAssemblyHostBuilder AddTheIdServerApp(this WebAssemblyHostBuilder builder) + { + var configuration = builder.Configuration; + var settings = configuration.Get(); + ConfigureLogging(builder.Logging, settings); + ConfigureServices(builder.Services, configuration, settings, builder.HostEnvironment.BaseAddress); + return builder; + } + + private static void ConfigureLogging(ILoggingBuilder logging, Settings settings) + { + var options = settings.LoggingOptions; + var filters = options.Filters; + if (filters != null) + { + foreach (var filter in filters) + { + logging.AddFilter(filter.Category, filter.Level); + } + } + logging.SetMinimumLevel(options.Minimum); + } + + public static void ConfigureServices(IServiceCollection services, IConfiguration configuration, Settings settings, string baseAddress) + { + services + .AddOptions() + .AddOidcAuthentication(options => + { + configuration.GetSection("AuthenticationPaths").Bind(options.AuthenticationPaths); + configuration.GetSection("UserOptions").Bind(options.UserOptions); + configuration.Bind("ProviderOptions", options.ProviderOptions); + }) + .AddAccountClaimsPrincipalFactory(); + + services.AddAuthorizationCore(options => + { + options.AddIdentityServerPolicies(); + }); + + + services + .AddIdentityServer4AdminHttpStores(p => + { + return Task.FromResult(CreateApiHttpClient(p, settings)); + }) + .AddSingleton(new HttpClient { BaseAddress = new Uri(baseAddress) }) + .AddSingleton(p => settings) + .AddSingleton() + .AddSingleton() + .AddTransient, UserAdminStore>() + .AddTransient, RoleAdminStore>() + .AddTransient, ExternalProviderStore>() + .AddHttpClient("oidc") + .AddHttpMessageHandler(); + } + + private static HttpClient CreateApiHttpClient(IServiceProvider p, Settings settings) + { + var httpClient = p.GetRequiredService() + .CreateClient("oidc"); + + var apiUri = new Uri(settings.ApiBaseUrl); + httpClient.BaseAddress = apiUri; + return httpClient; + } + + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/AccessTokenType.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/AccessTokenType.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/AccessTokenType.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/AccessTokenType.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/ClientUrl.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/ClientUrl.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/ClientUrl.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/ClientUrl.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/ExternalProvider.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/ExternalProvider.cs similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/ExternalProvider.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/ExternalProvider.cs index 1fa228cd1..0ea691b2e 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/ExternalProvider.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/ExternalProvider.cs @@ -1,62 +1,62 @@ -using Aguacongas.IdentityServer.Store; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json; -using System.Text.Json.Serialization; -using Entity = Aguacongas.IdentityServer.Store.Entity; - -namespace Aguacongas.TheIdServer.BlazorApp.Models -{ - public class ExternalProvider : Entity.ExternalProvider, ICloneable - { - [JsonIgnore] - public RemoteAuthenticationOptions Options { get; set; } - - [JsonIgnore] - public IEnumerable Kinds { get; set; } - - [JsonIgnore] - public RemoteAuthenticationOptions DefaultOptions - { - get - { - var optionsType = GetOptionsType(this); - return Deserialize(Kinds.First(k => k.KindName == KindName).SerializedDefaultOptions, optionsType); - } - } - - public override string SerializedHandlerType - { - get => Kinds.First(k => k.KindName == KindName).SerializedHandlerType; - set => base.SerializedHandlerType = value; - } - - public ExternalProvider Clone() - { - return MemberwiseClone() as ExternalProvider; - } - - public static ExternalProvider FromEntity(Entity.ExternalProvider externalProvider) - { - var optionsType = GetOptionsType(externalProvider); - return new ExternalProvider - { - DisplayName = externalProvider.DisplayName, - Id = externalProvider.Id, - KindName = externalProvider.KindName, - Options = Deserialize(externalProvider.SerializedOptions, optionsType) - }; - } - - private static RemoteAuthenticationOptions Deserialize(string options, Type optionsType) - { - return JsonSerializer.Deserialize(options, optionsType) as RemoteAuthenticationOptions; - } - - private static Type GetOptionsType(Entity.ExternalProvider externalProvider) - { - return Type.GetType($"{typeof(RemoteAuthenticationOptions).Namespace}.{externalProvider.KindName}Options"); - } - } -} +using Aguacongas.IdentityServer.Store; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using Entity = Aguacongas.IdentityServer.Store.Entity; + +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public class ExternalProvider : Entity.ExternalProvider, ICloneable + { + [JsonIgnore] + public RemoteAuthenticationOptions Options { get; set; } + + [JsonIgnore] + public IEnumerable Kinds { get; set; } + + [JsonIgnore] + public RemoteAuthenticationOptions DefaultOptions + { + get + { + var optionsType = GetOptionsType(this); + return Deserialize(Kinds.First(k => k.KindName == KindName).SerializedDefaultOptions, optionsType); + } + } + + public override string SerializedHandlerType + { + get => Kinds.First(k => k.KindName == KindName).SerializedHandlerType; + set => base.SerializedHandlerType = value; + } + + public ExternalProvider Clone() + { + return MemberwiseClone() as ExternalProvider; + } + + public static ExternalProvider FromEntity(Entity.ExternalProvider externalProvider) + { + var optionsType = GetOptionsType(externalProvider); + return new ExternalProvider + { + DisplayName = externalProvider.DisplayName, + Id = externalProvider.Id, + KindName = externalProvider.KindName, + Options = Deserialize(externalProvider.SerializedOptions, optionsType) + }; + } + + private static RemoteAuthenticationOptions Deserialize(string options, Type optionsType) + { + return JsonSerializer.Deserialize(options, optionsType) as RemoteAuthenticationOptions; + } + + private static Type GetOptionsType(Entity.ExternalProvider externalProvider) + { + return Type.GetType($"{typeof(RemoteAuthenticationOptions).Namespace}.{externalProvider.KindName}Options"); + } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/FacebookOptions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/FacebookOptions.cs similarity index 95% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/FacebookOptions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/FacebookOptions.cs index 57e7c4bc6..57be2b6e2 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/FacebookOptions.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/FacebookOptions.cs @@ -1,15 +1,15 @@ -using System.Collections.Generic; - -namespace Aguacongas.TheIdServer.BlazorApp.Models -{ - public class FacebookOptions : OAuthOptions - { - public string AppId { get; set; } - - public string AppSecret { get; set; } - - public bool SendAppSecretProof { get; set; } - - public ICollection Fields { get; set; } - } -} +using System.Collections.Generic; + +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public class FacebookOptions : OAuthOptions + { + public string AppId { get; set; } + + public string AppSecret { get; set; } + + public bool SendAppSecretProof { get; set; } + + public ICollection Fields { get; set; } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/GoogleOptions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/GoogleOptions.cs similarity index 95% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/GoogleOptions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/GoogleOptions.cs index 766192dd5..f327231dc 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/GoogleOptions.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/GoogleOptions.cs @@ -1,7 +1,7 @@ -namespace Aguacongas.TheIdServer.BlazorApp.Models -{ - public class GoogleOptions : OAuthOptions - { - public string AccessType { get; set; } - } -} +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public class GoogleOptions : OAuthOptions + { + public string AccessType { get; set; } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/GrantTypes.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/GrantTypes.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/GrantTypes.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/GrantTypes.cs diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/IEnumerable.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/IEnumerable.cs new file mode 100644 index 000000000..9d732e304 --- /dev/null +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/IEnumerable.cs @@ -0,0 +1,6 @@ +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public interface IEnumerable + { + } +} \ No newline at end of file diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/MicrosoftAccountOptions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/MicrosoftAccountOptions.cs similarity index 95% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/MicrosoftAccountOptions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/MicrosoftAccountOptions.cs index 119e99e14..43a445630 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/MicrosoftAccountOptions.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/MicrosoftAccountOptions.cs @@ -1,6 +1,6 @@ -namespace Aguacongas.TheIdServer.BlazorApp.Models -{ - public class MicrosoftAccountOptions : OAuthOptions - { - } -} +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public class MicrosoftAccountOptions : OAuthOptions + { + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/Notification.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Notification.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/Notification.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Notification.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/NotificationOptions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/NotificationOptions.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/NotificationOptions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/NotificationOptions.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/OAuthOptions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/OAuthOptions.cs similarity index 96% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/OAuthOptions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/OAuthOptions.cs index d942efad3..cd09a804d 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/OAuthOptions.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/OAuthOptions.cs @@ -1,21 +1,21 @@ -using System.Collections.Generic; - -namespace Aguacongas.TheIdServer.BlazorApp.Models -{ - public class OAuthOptions : RemoteAuthenticationOptions - { - public string AuthorizationEndpoint { get; set; } - - public string ClientId { get; set; } - - public string ClientSecret { get; set; } - - public string TokenEndpoint { get; set; } - - public bool UsePkce { get; set; } - - public string UserInformationEndpoint { get; set; } - - public ICollection Scope { get; set; } - } -} +using System.Collections.Generic; + +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public class OAuthOptions : RemoteAuthenticationOptions + { + public string AuthorizationEndpoint { get; set; } + + public string ClientId { get; set; } + + public string ClientSecret { get; set; } + + public string TokenEndpoint { get; set; } + + public bool UsePkce { get; set; } + + public string UserInformationEndpoint { get; set; } + + public ICollection Scope { get; set; } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/OpenIdConnectOptions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/OpenIdConnectOptions.cs similarity index 96% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/OpenIdConnectOptions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/OpenIdConnectOptions.cs index bde3ec337..315929ca7 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/OpenIdConnectOptions.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/OpenIdConnectOptions.cs @@ -1,42 +1,42 @@ -using System; -using System.Collections.Generic; - -namespace Aguacongas.TheIdServer.BlazorApp.Models -{ - public class OpenIdConnectOptions : RemoteAuthenticationOptions - { - public bool DisableTelemetry { get; set; } - - public bool SkipUnrecognizedRequests { get; set; } - - public bool UseTokenLifetime { get; set; } - - public string SignOutScheme { get; set; } - - public string RemoteSignOutPath { get; set; } - - public ICollection Scope { get; set; } - - public string Prompt { get; set; } - - public string ResponseType { get; set; } - - public string ResponseMode { get; set; } - - public string Resource { get; set; } - - public bool RefreshOnIssuerKeyNotFound { get; set; } - - public string Authority { get; set; } - - public string ClientId { get; set; } - - public string ClientSecret { get; set; } - - public bool RequireHttpsMetadata { get; set; } - - public TimeSpan? MaxAge { get; set; } - - public bool UsePkce { get; set; } - } -} +using System; +using System.Collections.Generic; + +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public class OpenIdConnectOptions : RemoteAuthenticationOptions + { + public bool DisableTelemetry { get; set; } + + public bool SkipUnrecognizedRequests { get; set; } + + public bool UseTokenLifetime { get; set; } + + public string SignOutScheme { get; set; } + + public string RemoteSignOutPath { get; set; } + + public ICollection Scope { get; set; } + + public string Prompt { get; set; } + + public string ResponseType { get; set; } + + public string ResponseMode { get; set; } + + public string Resource { get; set; } + + public bool RefreshOnIssuerKeyNotFound { get; set; } + + public string Authority { get; set; } + + public string ClientId { get; set; } + + public string ClientSecret { get; set; } + + public bool RequireHttpsMetadata { get; set; } + + public TimeSpan? MaxAge { get; set; } + + public bool UsePkce { get; set; } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/RefreshTokenExpiration.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/RefreshTokenExpiration.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/RefreshTokenExpiration.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/RefreshTokenExpiration.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/RefreshTokenUsage.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/RefreshTokenUsage.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/RefreshTokenUsage.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/RefreshTokenUsage.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/RemoteAuthenticationOptions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/RemoteAuthenticationOptions.cs similarity index 96% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/RemoteAuthenticationOptions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/RemoteAuthenticationOptions.cs index f1f58097e..96d04cce5 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/RemoteAuthenticationOptions.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/RemoteAuthenticationOptions.cs @@ -1,7 +1,7 @@ -namespace Aguacongas.TheIdServer.BlazorApp.Models -{ - public abstract class RemoteAuthenticationOptions - { - public bool SaveTokens { get; set; } - } -} +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public abstract class RemoteAuthenticationOptions + { + public bool SaveTokens { get; set; } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/Role.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Role.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/Role.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Role.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/Scope.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Scope.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/Scope.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Scope.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/SecretTypes.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/SecretTypes.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/SecretTypes.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/SecretTypes.cs diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Settings.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Settings.cs new file mode 100644 index 000000000..b3bac8380 --- /dev/null +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Settings.cs @@ -0,0 +1,28 @@ +using Microsoft.Extensions.Logging; +using System.Collections.Generic; + +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public class Settings + { + public LoggingOptions LoggingOptions { get; set; } + public string ApiBaseUrl { get; set; } + + public string AdministratorEmail { get; set; } + public string WelcomeContenUrl { get; set; } + } + + public class LoggingOptions + { + public LogLevel Minimum { get; set; } + + public IEnumerable Filters { get; set; } + } + + public class Filter + { + public string Category { get; set; } + + public LogLevel Level { get; set; } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/SortEventArgs.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/SortEventArgs.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/SortEventArgs.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/SortEventArgs.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/Token.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Token.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/Token.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Token.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/TokenData.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/TokenData.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/TokenData.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/TokenData.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/TwitterOptions.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/TwitterOptions.cs similarity index 95% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/TwitterOptions.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/TwitterOptions.cs index 97612e1b3..0d3964070 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/TwitterOptions.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/TwitterOptions.cs @@ -1,12 +1,12 @@ -namespace Aguacongas.TheIdServer.BlazorApp.Models -{ - public class TwitterOptions : RemoteAuthenticationOptions - { - - public string ConsumerKey { get; set; } - - public string ConsumerSecret { get; set; } - - public bool RetrieveUserDetails { get; set; } - } -} +namespace Aguacongas.TheIdServer.BlazorApp.Models +{ + public class TwitterOptions : RemoteAuthenticationOptions + { + + public string ConsumerKey { get; set; } + + public string ConsumerSecret { get; set; } + + public bool RetrieveUserDetails { get; set; } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Models/User.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/User.cs similarity index 94% rename from src/Aguacongas.TheIdServer.BlazorApp/Models/User.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/User.cs index bc0a05c14..d9e143d65 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Models/User.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/User.cs @@ -15,8 +15,8 @@ public class User : Entity.User, ICloneable public ICollection Roles { get; set; } public ICollection Tokens { get; set; } - public List ReferenceTokens { get; internal set; } - public List RefreshTokens { get; internal set; } + public List ReferenceTokens { get; set; } + public List RefreshTokens { get; set; } public new User Clone() { diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Services/ClaimsPrincipalFactory.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/ClaimsPrincipalFactory.cs similarity index 95% rename from src/Aguacongas.TheIdServer.BlazorApp/Services/ClaimsPrincipalFactory.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/ClaimsPrincipalFactory.cs index c01aeb483..c66267cfc 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Services/ClaimsPrincipalFactory.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/ClaimsPrincipalFactory.cs @@ -35,7 +35,7 @@ public override async ValueTask CreateUserAsync(RemoteUserAccou var type = claim.Type; foreach(var item in values) { - _logger.LogInformation($"Add {type} claim {item}"); + _logger.LogDebug($"Add {type} claim {item}"); identity.AddClaim(new Claim(type, item)); } identity.RemoveClaim(claim); diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Services/ExternalProviderStore.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/ExternalProviderStore.cs similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Services/ExternalProviderStore.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/ExternalProviderStore.cs index 4a4841f56..787bcb1fa 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Services/ExternalProviderStore.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/ExternalProviderStore.cs @@ -1,59 +1,59 @@ -using Aguacongas.IdentityServer.Store; -using Aguacongas.TheIdServer.BlazorApp.Models; -using System; -using System.Threading; -using System.Threading.Tasks; -using Entity = Aguacongas.IdentityServer.Store.Entity; - -namespace Aguacongas.TheIdServer.BlazorApp.Services -{ - public class ExternalProviderStore : IAdminStore - { - private readonly IAdminStore _store; - - public ExternalProviderStore(IAdminStore store) - { - _store = store ?? throw new ArgumentNullException(nameof(store)); - } - - public async Task CreateAsync(ExternalProvider entity, CancellationToken cancellationToken = default) - { - return ExternalProvider.FromEntity(await _store.CreateAsync(entity, cancellationToken) - .ConfigureAwait(false)); - } - - public async Task CreateAsync(object entity, CancellationToken cancellationToken = default) - { - return await CreateAsync(entity as ExternalProvider, cancellationToken) - .ConfigureAwait(false); - } - - public Task DeleteAsync(string id, CancellationToken cancellationToken = default) - { - return _store.DeleteAsync(id, cancellationToken); - } - - public async Task GetAsync(string id, GetRequest request, CancellationToken cancellationToken = default) - { - return ExternalProvider.FromEntity(await _store.GetAsync(id, request, cancellationToken) - .ConfigureAwait(false)); - } - - public Task> GetAsync(PageRequest request, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public async Task UpdateAsync(ExternalProvider entity, CancellationToken cancellationToken = default) - { - return ExternalProvider.FromEntity(await _store.UpdateAsync(entity, cancellationToken) - .ConfigureAwait(false)); - } - - public async Task UpdateAsync(object entity, CancellationToken cancellationToken = default) - { - return await UpdateAsync(entity as ExternalProvider, cancellationToken) - .ConfigureAwait(false); - } - } -} +using Aguacongas.IdentityServer.Store; +using Aguacongas.TheIdServer.BlazorApp.Models; +using System; +using System.Threading; +using System.Threading.Tasks; +using Entity = Aguacongas.IdentityServer.Store.Entity; + +namespace Aguacongas.TheIdServer.BlazorApp.Services +{ + public class ExternalProviderStore : IAdminStore + { + private readonly IAdminStore _store; + + public ExternalProviderStore(IAdminStore store) + { + _store = store ?? throw new ArgumentNullException(nameof(store)); + } + + public async Task CreateAsync(ExternalProvider entity, CancellationToken cancellationToken = default) + { + return ExternalProvider.FromEntity(await _store.CreateAsync(entity, cancellationToken) + .ConfigureAwait(false)); + } + + public async Task CreateAsync(object entity, CancellationToken cancellationToken = default) + { + return await CreateAsync(entity as ExternalProvider, cancellationToken) + .ConfigureAwait(false); + } + + public Task DeleteAsync(string id, CancellationToken cancellationToken = default) + { + return _store.DeleteAsync(id, cancellationToken); + } + + public async Task GetAsync(string id, GetRequest request, CancellationToken cancellationToken = default) + { + return ExternalProvider.FromEntity(await _store.GetAsync(id, request, cancellationToken) + .ConfigureAwait(false)); + } + + public Task> GetAsync(PageRequest request, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public async Task UpdateAsync(ExternalProvider entity, CancellationToken cancellationToken = default) + { + return ExternalProvider.FromEntity(await _store.UpdateAsync(entity, cancellationToken) + .ConfigureAwait(false)); + } + + public async Task UpdateAsync(object entity, CancellationToken cancellationToken = default) + { + return await UpdateAsync(entity as ExternalProvider, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Services/GridState.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/GridState.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Services/GridState.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/GridState.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Services/HandleModificationState.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/HandleModificationState.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Services/HandleModificationState.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/HandleModificationState.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Services/Notifier.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/Notifier.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Services/Notifier.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/Notifier.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Services/RoleAdminStore.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/RoleAdminStore.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Services/RoleAdminStore.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/RoleAdminStore.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Services/UserAdminStore.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/UserAdminStore.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Services/UserAdminStore.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/UserAdminStore.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiClaimValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiClaimValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiClaimValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiClaimValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiPropertyValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiPropertyValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiPropertyValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiPropertyValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiScopeClaimValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiScopeClaimValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiScopeClaimValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiScopeClaimValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiScopeValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiScopeValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiScopeValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiScopeValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiSecretValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiSecretValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ApiSecretValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ApiSecretValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientGrantTypeValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientGrantTypeValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientGrantTypeValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientGrantTypeValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientPropertyValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientPropertyValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientPropertyValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientPropertyValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientRedirectUriValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientRedirectUriValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientRedirectUriValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientRedirectUriValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientScopeValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientScopeValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientScopeValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientScopeValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientUriValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientUriValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientUriValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientUriValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ClientValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ClientValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ExternalProviderValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ExternalProviderValidator.cs similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ExternalProviderValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ExternalProviderValidator.cs index 9d925c96f..cd4738a00 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ExternalProviderValidator.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ExternalProviderValidator.cs @@ -1,16 +1,16 @@ -using Aguacongas.TheIdServer.BlazorApp.Models; -using FluentValidation; - -namespace Aguacongas.TheIdServer.BlazorApp.Validators -{ - public class ExternalProviderValidator: AbstractValidator - { - public ExternalProviderValidator(ExternalProvider externalProvider) - { - RuleFor(m => m.Id).NotEmpty().WithMessage("The sheme is required."); - RuleFor(m => m.DisplayName).NotEmpty().WithMessage("The display name is required."); - RuleFor(m => m.KindName).NotEmpty().WithMessage("The kind of provider is required."); - RuleFor(m => m.Options).SetValidator(p => new RemoteAuthenticationOptionsValidator(externalProvider)); - } - } -} +using Aguacongas.TheIdServer.BlazorApp.Models; +using FluentValidation; + +namespace Aguacongas.TheIdServer.BlazorApp.Validators +{ + public class ExternalProviderValidator: AbstractValidator + { + public ExternalProviderValidator(ExternalProvider externalProvider) + { + RuleFor(m => m.Id).NotEmpty().WithMessage("The sheme is required."); + RuleFor(m => m.DisplayName).NotEmpty().WithMessage("The display name is required."); + RuleFor(m => m.KindName).NotEmpty().WithMessage("The kind of provider is required."); + RuleFor(m => m.Options).SetValidator(p => new RemoteAuthenticationOptionsValidator(externalProvider)); + } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/FacebookOptionsValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/FacebookOptionsValidator.cs similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/FacebookOptionsValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/FacebookOptionsValidator.cs index 21dec125d..ac8712a90 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Validators/FacebookOptionsValidator.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/FacebookOptionsValidator.cs @@ -1,14 +1,14 @@ -using Aguacongas.TheIdServer.BlazorApp.Models; -using FluentValidation; - -namespace Aguacongas.TheIdServer.BlazorApp.Validators -{ - public class FacebookOptionsValidator : AbstractValidator - { - public FacebookOptionsValidator(ExternalProvider _) - { - RuleFor(m => m.AppId).NotEmpty().WithMessage("Client Id is required."); - RuleFor(m => m.AppSecret).NotEmpty().WithMessage("Client Secret is required."); - } - } +using Aguacongas.TheIdServer.BlazorApp.Models; +using FluentValidation; + +namespace Aguacongas.TheIdServer.BlazorApp.Validators +{ + public class FacebookOptionsValidator : AbstractValidator + { + public FacebookOptionsValidator(ExternalProvider _) + { + RuleFor(m => m.AppId).NotEmpty().WithMessage("Client Id is required."); + RuleFor(m => m.AppSecret).NotEmpty().WithMessage("Client Secret is required."); + } + } } \ No newline at end of file diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/GoogleOptionsValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/GoogleOptionsValidator.cs similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/GoogleOptionsValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/GoogleOptionsValidator.cs index da11b0ce2..e8977cc72 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Validators/GoogleOptionsValidator.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/GoogleOptionsValidator.cs @@ -1,14 +1,14 @@ -using Aguacongas.TheIdServer.BlazorApp.Models; -using FluentValidation; - -namespace Aguacongas.TheIdServer.BlazorApp.Validators -{ - public class GoogleOptionsValidator : AbstractValidator - { - public GoogleOptionsValidator(ExternalProvider _) - { - RuleFor(m => m.ClientId).NotEmpty().WithMessage("Client Id is required."); - RuleFor(m => m.ClientSecret).NotEmpty().WithMessage("Client Secret is required."); - } - } -} +using Aguacongas.TheIdServer.BlazorApp.Models; +using FluentValidation; + +namespace Aguacongas.TheIdServer.BlazorApp.Validators +{ + public class GoogleOptionsValidator : AbstractValidator + { + public GoogleOptionsValidator(ExternalProvider _) + { + RuleFor(m => m.ClientId).NotEmpty().WithMessage("Client Id is required."); + RuleFor(m => m.ClientSecret).NotEmpty().WithMessage("Client Secret is required."); + } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/IdentityClaimValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/IdentityClaimValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/IdentityClaimValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/IdentityClaimValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/IdentityProrpertyValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/IdentityProrpertyValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/IdentityProrpertyValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/IdentityProrpertyValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/IdentityResourceValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/IdentityResourceValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/IdentityResourceValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/IdentityResourceValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/OAuthOptionsValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/OAuthOptionsValidator.cs similarity index 98% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/OAuthOptionsValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/OAuthOptionsValidator.cs index 2aa22e49c..777a40c4a 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Validators/OAuthOptionsValidator.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/OAuthOptionsValidator.cs @@ -1,19 +1,19 @@ -using Aguacongas.TheIdServer.BlazorApp.Models; -using FluentValidation; - -namespace Aguacongas.TheIdServer.BlazorApp.Validators -{ - public class OAuthOptionsValidator : AbstractValidator - { - public OAuthOptionsValidator(ExternalProvider _) - { - RuleFor(m => m.ClientId).NotEmpty().WithMessage("Client Id is required."); - RuleFor(m => m.AuthorizationEndpoint).NotEmpty().WithMessage("Authorization endpoint is required."); - RuleFor(m => m.AuthorizationEndpoint).Uri().WithMessage("Authorization endpoint must be a valid uri."); - RuleFor(m => m.TokenEndpoint).NotEmpty().WithMessage("Token endpoint is required."); - RuleFor(m => m.TokenEndpoint).Uri().WithMessage("Token endpoint must be a valid uri."); - RuleFor(m => m.UserInformationEndpoint).NotEmpty().WithMessage("User information endpoint is required."); - RuleFor(m => m.UserInformationEndpoint).Uri().WithMessage("User information endpoint must be a valid uri."); - } - } +using Aguacongas.TheIdServer.BlazorApp.Models; +using FluentValidation; + +namespace Aguacongas.TheIdServer.BlazorApp.Validators +{ + public class OAuthOptionsValidator : AbstractValidator + { + public OAuthOptionsValidator(ExternalProvider _) + { + RuleFor(m => m.ClientId).NotEmpty().WithMessage("Client Id is required."); + RuleFor(m => m.AuthorizationEndpoint).NotEmpty().WithMessage("Authorization endpoint is required."); + RuleFor(m => m.AuthorizationEndpoint).Uri().WithMessage("Authorization endpoint must be a valid uri."); + RuleFor(m => m.TokenEndpoint).NotEmpty().WithMessage("Token endpoint is required."); + RuleFor(m => m.TokenEndpoint).Uri().WithMessage("Token endpoint must be a valid uri."); + RuleFor(m => m.UserInformationEndpoint).NotEmpty().WithMessage("User information endpoint is required."); + RuleFor(m => m.UserInformationEndpoint).Uri().WithMessage("User information endpoint must be a valid uri."); + } + } } \ No newline at end of file diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/OpenIdConnectOptionsValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/OpenIdConnectOptionsValidator.cs similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/OpenIdConnectOptionsValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/OpenIdConnectOptionsValidator.cs index 6dbf08dd4..6807feb96 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Validators/OpenIdConnectOptionsValidator.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/OpenIdConnectOptionsValidator.cs @@ -1,15 +1,15 @@ -using Aguacongas.TheIdServer.BlazorApp.Models; -using FluentValidation; - -namespace Aguacongas.TheIdServer.BlazorApp.Validators -{ - public class OpenIdConnectOptionsValidator : AbstractValidator - { - public OpenIdConnectOptionsValidator(ExternalProvider _) - { - RuleFor(m => m.Authority).NotEmpty().WithMessage("Authority is required."); - RuleFor(m => m.Authority).Uri().WithMessage("Authority must be a valid uir."); - RuleFor(m => m.ClientId).NotEmpty().WithMessage("Client Id is required."); - } - } +using Aguacongas.TheIdServer.BlazorApp.Models; +using FluentValidation; + +namespace Aguacongas.TheIdServer.BlazorApp.Validators +{ + public class OpenIdConnectOptionsValidator : AbstractValidator + { + public OpenIdConnectOptionsValidator(ExternalProvider _) + { + RuleFor(m => m.Authority).NotEmpty().WithMessage("Authority is required."); + RuleFor(m => m.Authority).Uri().WithMessage("Authority must be a valid uir."); + RuleFor(m => m.ClientId).NotEmpty().WithMessage("Client Id is required."); + } + } } \ No newline at end of file diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/ProtectResourceValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ProtectResourceValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/ProtectResourceValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/ProtectResourceValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/RemoteAuthenticationOptionsValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/RemoteAuthenticationOptionsValidator.cs similarity index 98% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/RemoteAuthenticationOptionsValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/RemoteAuthenticationOptionsValidator.cs index 48f237a4f..157f0f7dd 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Validators/RemoteAuthenticationOptionsValidator.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/RemoteAuthenticationOptionsValidator.cs @@ -1,33 +1,33 @@ -using Aguacongas.TheIdServer.BlazorApp.Models; -using FluentValidation; -using FluentValidation.Results; -using System; - -namespace Aguacongas.TheIdServer.BlazorApp.Validators -{ - public class RemoteAuthenticationOptionsValidator : AbstractValidator - { - private readonly ExternalProvider _provider; - - public RemoteAuthenticationOptionsValidator(ExternalProvider provider) - { - _provider = provider ?? throw new ArgumentNullException(nameof(provider)); - } - - public override ValidationResult Validate(ValidationContext context) - { - var options = _provider.Options; - var optionsType = options.GetType(); - return optionsType.Name switch - { - nameof(GoogleOptions) => new GoogleOptionsValidator(_provider).Validate(options as GoogleOptions), - nameof(FacebookOptions) => new FacebookOptionsValidator(_provider).Validate(options as FacebookOptions), - nameof(OAuthOptions) => new OAuthOptionsValidator(_provider).Validate(options as OAuthOptions), - nameof(MicrosoftAccountOptions) => new OAuthOptionsValidator(_provider).Validate(options as OAuthOptions), - nameof(OpenIdConnectOptions) => new OpenIdConnectOptionsValidator(_provider).Validate(options as OpenIdConnectOptions), - nameof(TwitterOptions) => new TwitterOptionsValidator(_provider).Validate(options as TwitterOptions), - _ => base.Validate(context), - }; - } - } +using Aguacongas.TheIdServer.BlazorApp.Models; +using FluentValidation; +using FluentValidation.Results; +using System; + +namespace Aguacongas.TheIdServer.BlazorApp.Validators +{ + public class RemoteAuthenticationOptionsValidator : AbstractValidator + { + private readonly ExternalProvider _provider; + + public RemoteAuthenticationOptionsValidator(ExternalProvider provider) + { + _provider = provider ?? throw new ArgumentNullException(nameof(provider)); + } + + public override ValidationResult Validate(ValidationContext context) + { + var options = _provider.Options; + var optionsType = options.GetType(); + return optionsType.Name switch + { + nameof(GoogleOptions) => new GoogleOptionsValidator(_provider).Validate(options as GoogleOptions), + nameof(FacebookOptions) => new FacebookOptionsValidator(_provider).Validate(options as FacebookOptions), + nameof(OAuthOptions) => new OAuthOptionsValidator(_provider).Validate(options as OAuthOptions), + nameof(MicrosoftAccountOptions) => new OAuthOptionsValidator(_provider).Validate(options as OAuthOptions), + nameof(OpenIdConnectOptions) => new OpenIdConnectOptionsValidator(_provider).Validate(options as OpenIdConnectOptions), + nameof(TwitterOptions) => new TwitterOptionsValidator(_provider).Validate(options as TwitterOptions), + _ => base.Validate(context), + }; + } + } } \ No newline at end of file diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/RoleClaimValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/RoleClaimValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/RoleClaimValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/RoleClaimValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/RoleValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/RoleValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/RoleValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/RoleValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/TokenValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/TokenValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/TokenValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/TokenValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/TwitterOptionsValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/TwitterOptionsValidator.cs similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/TwitterOptionsValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/TwitterOptionsValidator.cs index 6bab4f8d3..8bb73ee85 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Validators/TwitterOptionsValidator.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/TwitterOptionsValidator.cs @@ -1,14 +1,14 @@ -using Aguacongas.TheIdServer.BlazorApp.Models; -using FluentValidation; - -namespace Aguacongas.TheIdServer.BlazorApp.Validators -{ - public class TwitterOptionsValidator : AbstractValidator - { - public TwitterOptionsValidator(ExternalProvider _) - { - RuleFor(m => m.ConsumerKey).NotEmpty().WithMessage("Consumer Key is required."); - RuleFor(m => m.ConsumerSecret).NotEmpty().WithMessage("Consumer Secret is required."); - } - } +using Aguacongas.TheIdServer.BlazorApp.Models; +using FluentValidation; + +namespace Aguacongas.TheIdServer.BlazorApp.Validators +{ + public class TwitterOptionsValidator : AbstractValidator + { + public TwitterOptionsValidator(ExternalProvider _) + { + RuleFor(m => m.ConsumerKey).NotEmpty().WithMessage("Consumer Key is required."); + RuleFor(m => m.ConsumerSecret).NotEmpty().WithMessage("Consumer Secret is required."); + } + } } \ No newline at end of file diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/UniqueValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UniqueValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/UniqueValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UniqueValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/UriValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UriValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/UriValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UriValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/UserClaimValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UserClaimValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/UserClaimValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UserClaimValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/UserRoleValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UserRoleValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/UserRoleValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UserRoleValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Validators/UserValidator.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UserValidator.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Validators/UserValidator.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Validators/UserValidator.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/wwwroot/scripts/interop.js b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/wwwroot/TheIdServerInterop.js similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/wwwroot/scripts/interop.js rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/wwwroot/TheIdServerInterop.js diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Aguacongas.TheIdServer.BlazorApp.Pages.csproj b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Aguacongas.TheIdServer.BlazorApp.Pages.csproj new file mode 100644 index 000000000..44e32122f --- /dev/null +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Aguacongas.TheIdServer.BlazorApp.Pages.csproj @@ -0,0 +1,27 @@ + + + + netstandard2.1 + Olivier Lefebvre + Copyright (c) 2020 @Olivier Lefebvre + https://raw.githubusercontent.com/Aguafrommars/TheIdServer/master/LICENSE + https://github.com/Aguafrommars/TheIdServer/tree/master/src/Aguacongas.TheIdServer.BlazorApp + https://github.com/Aguafrommars/TheIdServer + git + theidserver;identityserver4;oidc;oauth;identity,authentication;security + TheIdServer administration application pages. + Full + 3.0 + + + + + + + + + + + + + diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Api.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Api.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Api.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Api.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Api.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Api.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Api.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Api.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Apis.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Apis.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Apis.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Apis.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Apis.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Apis.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Apis.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Apis.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Authentication.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Authentication.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Authentication.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Authentication.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Client.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Client.razor similarity index 99% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Client.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Client.razor index 9e73071f5..2307143be 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Client.razor +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Client.razor @@ -210,8 +210,8 @@ else
    - @if(Model.ClientSecrets.Any()) - { + @if(Model.ClientSecrets.Any()) + {
    diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Client.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Client.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Client.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Client.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Clients.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Clients.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Clients.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Clients.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Clients.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Clients.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Clients.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Clients.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/EntitiesModel.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/EntitiesModel.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/EntitiesModel.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/EntitiesModel.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/EntityModel.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/EntityModel.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/EntityModel.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/EntityModel.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProvider.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProvider.razor similarity index 99% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProvider.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProvider.razor index 46f9ae20d..551e7aa51 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProvider.razor +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProvider.razor @@ -69,18 +69,18 @@ else case "Facebook": break; - case "MicrosoftAccount": + case "MicrosoftAccount": - break; + break; case "OAuth": - break; - case "OpenIdConnect": + break; + case "OpenIdConnect": - break; + break; case "Twitter": - break; + break; }
    diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProvider.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProvider.razor.cs similarity index 84% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProvider.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProvider.razor.cs index 69de9fed4..dca3980c3 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProvider.razor.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProvider.razor.cs @@ -1,42 +1,45 @@ -using Aguacongas.IdentityServer.Store; -using Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents; -using System.Threading.Tasks; - -namespace Aguacongas.TheIdServer.BlazorApp.Pages -{ - public partial class ExternalProvider - { - private ProviderOptionsBase _optionsComponent; - - protected override string Expand => "Secrets,Scopes,Scopes/ApiScopeClaims,ApiClaims,Properties"; - - protected override bool NonEditable => false; - - protected override string BackUrl => "providers"; - - protected override void SetNavigationProperty(TEntity entity) - { - // no nav - } - - protected override Models.ExternalProvider Create() - { - return new Models.ExternalProvider(); - } - - protected override async Task OnInitializedAsync() - { - await base.OnInitializedAsync().ConfigureAwait(false); - var providerKindsResponse = await _providerKindStore.GetAsync(new PageRequest()).ConfigureAwait(false); - Model.Kinds = providerKindsResponse.Items; - } - - protected override void SanetizeEntityToSaved(TEntity entity) - { - if (entity is Models.ExternalProvider provider) - { - provider.SerializedOptions = _optionsComponent.SerializeOptions(); - } - } - } -} +using Aguacongas.IdentityServer.Store; +using Aguacongas.TheIdServer.BlazorApp.Components.ExternalProviderComponents; +using System.Diagnostics.CodeAnalysis; +using System.Threading.Tasks; + +namespace Aguacongas.TheIdServer.BlazorApp.Pages +{ + public partial class ExternalProvider + { + [SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Used in component")] + [SuppressMessage("Major", "CS0649:Fiel is never asign to", Justification = "Assign by jsScript.")] + private ProviderOptionsBase _optionsComponent; + + protected override string Expand => "Secrets,Scopes,Scopes/ApiScopeClaims,ApiClaims,Properties"; + + protected override bool NonEditable => false; + + protected override string BackUrl => "providers"; + + protected override void SetNavigationProperty(TEntity entity) + { + // no nav + } + + protected override Models.ExternalProvider Create() + { + return new Models.ExternalProvider(); + } + + protected override async Task OnInitializedAsync() + { + await base.OnInitializedAsync().ConfigureAwait(false); + var providerKindsResponse = await _providerKindStore.GetAsync(new PageRequest()).ConfigureAwait(false); + Model.Kinds = providerKindsResponse.Items; + } + + protected override void SanetizeEntityToSaved(TEntity entity) + { + if (entity is Models.ExternalProvider provider) + { + provider.SerializedOptions = _optionsComponent.SerializeOptions(); + } + } + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProviders.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProviders.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProviders.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProviders.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProviders.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProviders.razor.cs similarity index 97% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProviders.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProviders.razor.cs index 03c7e417e..e0f07383e 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Pages/ExternalProviders.razor.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/ExternalProviders.razor.cs @@ -1,9 +1,9 @@ -using Entity = Aguacongas.IdentityServer.Store.Entity; - -namespace Aguacongas.TheIdServer.BlazorApp.Pages -{ - public partial class ExternalProviders - { - protected override string SelectProperties => $"{nameof(Entity.ExternalProvider.Id)},{nameof(Entity.ExternalProvider.DisplayName)},{nameof(Entity.ExternalProvider.KindName)}"; - } -} +using Entity = Aguacongas.IdentityServer.Store.Entity; + +namespace Aguacongas.TheIdServer.BlazorApp.Pages +{ + public partial class ExternalProviders + { + protected override string SelectProperties => $"{nameof(Entity.ExternalProvider.Id)},{nameof(Entity.ExternalProvider.DisplayName)},{nameof(Entity.ExternalProvider.KindName)}"; + } +} diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Identity.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Identity.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Identity.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Identity.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Identity.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Identity.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Identity.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Identity.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Indenties.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Indenties.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Indenties.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Indenties.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Indenties.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Indenties.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Indenties.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Indenties.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Index.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Index.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Index.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Index.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Index.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Index.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Index.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Index.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Role.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Role.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Role.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Role.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Role.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Role.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Role.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Role.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Roles.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Roles.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Roles.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Roles.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Roles.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Roles.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Roles.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Roles.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/User.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/User.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/User.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/User.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/User.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/User.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/User.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/User.razor.cs diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Users.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Users.razor similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Users.razor rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Users.razor diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Pages/Users.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Users.razor.cs similarity index 100% rename from src/Aguacongas.TheIdServer.BlazorApp/Pages/Users.razor.cs rename to src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/Users.razor.cs diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/_Imports.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/_Imports.razor new file mode 100644 index 000000000..88c08b30b --- /dev/null +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages/_Imports.razor @@ -0,0 +1,15 @@ +@using System.Net.Http +@using Microsoft.AspNetCore.Components.Authorization +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Identity +@using Microsoft.JSInterop +@using Aguacongas.IdentityServer.Store +@using Aguacongas.TheIdServer.BlazorApp +@using Aguacongas.TheIdServer.BlazorApp.Components +@using Aguacongas.TheIdServer.BlazorApp.Components.Form +@using Aguacongas.TheIdServer.BlazorApp.Extensions +@using Aguacongas.TheIdServer.BlazorApp.Models +@using Aguacongas.TheIdServer.BlazorApp.Services +@using Entity = Aguacongas.IdentityServer.Store.Entity diff --git a/src/IdentityServer/Aguacongas.IdentityServer.Admin.Http.Store/HttpStoreBase.cs b/src/IdentityServer/Aguacongas.IdentityServer.Admin.Http.Store/HttpStoreBase.cs index 9656165fb..6747c1b37 100644 --- a/src/IdentityServer/Aguacongas.IdentityServer.Admin.Http.Store/HttpStoreBase.cs +++ b/src/IdentityServer/Aguacongas.IdentityServer.Admin.Http.Store/HttpStoreBase.cs @@ -119,7 +119,7 @@ protected Uri GetUri(HttpClient httpClient, string uri) } var result = new Uri($"{baseAddress}{uri}"); - Logger.LogInformation($"Request {result}"); + Logger.LogDebug($"Request {result}"); return result; } } diff --git a/src/IdentityServer/Aguacongas.IdentityServer.Http.Store/Extensions/ServiceCollectionExtensions.cs b/src/IdentityServer/Aguacongas.IdentityServer.Http.Store/Extensions/ServiceCollectionExtensions.cs index 6c426be94..1addc030c 100644 --- a/src/IdentityServer/Aguacongas.IdentityServer.Http.Store/Extensions/ServiceCollectionExtensions.cs +++ b/src/IdentityServer/Aguacongas.IdentityServer.Http.Store/Extensions/ServiceCollectionExtensions.cs @@ -3,7 +3,6 @@ using Aguacongas.IdentityServer.Store; using IdentityServer4.Services; using IdentityServer4.Stores; -using Microsoft.Extensions.Options; using System; using System.Net.Http; using System.Threading.Tasks; diff --git a/src/IdentityServer/Aguacongas.IdentityServer/HubConnectionFactory.cs b/src/IdentityServer/Aguacongas.IdentityServer/HubConnectionFactory.cs index 53a4f335b..1d73310cf 100644 --- a/src/IdentityServer/Aguacongas.IdentityServer/HubConnectionFactory.cs +++ b/src/IdentityServer/Aguacongas.IdentityServer/HubConnectionFactory.cs @@ -5,7 +5,6 @@ using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.Net.Http; using System.Threading.Tasks; namespace Aguacongas.IdentityServer diff --git a/test/Aguacongas.TheIdServer.IntegrationTest/BlazorApp/AppTest.cs b/test/Aguacongas.TheIdServer.IntegrationTest/BlazorApp/AppTest.cs index 79330e349..4fbae64c1 100644 --- a/test/Aguacongas.TheIdServer.IntegrationTest/BlazorApp/AppTest.cs +++ b/test/Aguacongas.TheIdServer.IntegrationTest/BlazorApp/AppTest.cs @@ -1,4 +1,5 @@ -using Aguacongas.TheIdServer.Data; +using Aguacongas.TheIdServer.BlazorApp.Models; +using Aguacongas.TheIdServer.Data; using Aguacongas.TheIdServer.Models; using HtmlAgilityPack; using Microsoft.AspNetCore.Authorization; @@ -6,6 +7,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Routing; using Microsoft.AspNetCore.Components.Testing; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.TestHost; @@ -163,7 +165,8 @@ private static void OpenLogggedPage(TestLoggerProvider testLoggerProvider, HttpC host.ConfigureServices(services => { - blazorApp.Program.ConfigureServices(services, TestUtils.CreateApplicationConfiguration(httpClient), httpClient.BaseAddress.ToString()); + var configuration = TestUtils.CreateApplicationConfiguration(httpClient); + WebAssemblyHostBuilderExtensions.ConfigureServices(services, configuration, configuration.Get(), httpClient.BaseAddress.ToString()); services .AddLogging(configure => { @@ -237,7 +240,8 @@ private static void NavigateToLoginPage(TestLoggerProvider testLoggerProvider, T host.ConfigureServices(services => { - blazorApp.Program.ConfigureServices(services, TestUtils.CreateApplicationConfiguration(client), client.BaseAddress.ToString()); + var configuration = TestUtils.CreateApplicationConfiguration(client); + WebAssemblyHostBuilderExtensions.ConfigureServices(services, configuration, configuration.Get(), client.BaseAddress.ToString()); services .AddLogging(configure => { diff --git a/test/Aguacongas.TheIdServer.IntegrationTest/TestUtils.cs b/test/Aguacongas.TheIdServer.IntegrationTest/TestUtils.cs index 08a31bb9b..952f4572b 100644 --- a/test/Aguacongas.TheIdServer.IntegrationTest/TestUtils.cs +++ b/test/Aguacongas.TheIdServer.IntegrationTest/TestUtils.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Components.Testing; using Microsoft.AspNetCore.Components.WebAssembly.Authentication; using Microsoft.AspNetCore.Components.WebAssembly.Authentication.Internal; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.Configuration; @@ -99,7 +100,7 @@ public static void CreateTestHost(string userName, IEnumerable claims, st var httpClient = sut.CreateClient(); var appConfiguration = CreateApplicationConfiguration(httpClient); - blazorApp.Program.ConfigureServices(services, appConfiguration, httpClient.BaseAddress.ToString()); + WebAssemblyHostBuilderExtensions.ConfigureServices(services, appConfiguration, appConfiguration.Get(), httpClient.BaseAddress.ToString()); sut.Services.GetRequiredService() .SetTestUser(true, claims.Select(c => new Claim(c.Type, c.Value)));