diff --git a/Directory.Packages.props b/Directory.Packages.props index 3fb37c3fef..6957d06804 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -113,11 +113,11 @@ - - - - - + + + + + diff --git a/docs/en/Migration-Guides/OpenIddict4-to-5.md b/docs/en/Migration-Guides/OpenIddict4-to-5.md new file mode 100644 index 0000000000..9080ae7876 --- /dev/null +++ b/docs/en/Migration-Guides/OpenIddict4-to-5.md @@ -0,0 +1,108 @@ +# OpenIddict 4.x to 5.x Migration Guide + +The 5.0 release of OpenIddict is a major release that introduces breaking changes. + +Check this blog [Introducing native applications, per-client token lifetimes and client assertions support in OpenIddict 5.0 preview1](https://kevinchalet.com/2023/10/20/introducing-native-applications-per-client-token-lifetimes-and-client-assertions-support-in-openiddict-5-0-preview1/) for the new features introduced in OpenIddict 5.0. + +I will show the changes you need to make to do the migration. + +> Please backup your database before doing the migration. + +## OpenIddictApplication changes + +1. The `Type(string)` of the `OpenIddictApplication` has been renamed to `ClientType(string)`. +2. The `ApplicationType(string)` has been added to the `OpenIddictApplication` entity. +3. The `JsonWebKeySet(string)` has been added to the `OpenIddictApplication` entity. +4. The `Settings(string)` has been added to the `OpenIddictApplication` entity. + +The new migration looks like this: + +````csharp +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OpenIddict.Demo.Server.Migrations +{ + /// + public partial class openiddict5 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "Type", + table: "OpenIddictApplications", + newName: "ClientType"); + + migrationBuilder.AddColumn( + name: "ApplicationType", + table: "OpenIddictApplications", + type: "nvarchar(50)", + maxLength: 50, + nullable: true); + + migrationBuilder.AddColumn( + name: "JsonWebKeySet", + table: "OpenIddictApplications", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Settings", + table: "OpenIddictApplications", + type: "nvarchar(max)", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ApplicationType", + table: "OpenIddictApplications"); + + migrationBuilder.DropColumn( + name: "JsonWebKeySet", + table: "OpenIddictApplications"); + + migrationBuilder.DropColumn( + name: "Settings", + table: "OpenIddictApplications"); + + migrationBuilder.RenameColumn( + name: "ClientType", + table: "OpenIddictApplications", + newName: "Type"); + } + } +} +```` + +## OpenIddictApplicationModel changes + +1. The `Type(string)` of the `OpenIddictApplicationModel` has been renamed to `ClientType(string)`. +2. The `ApplicationType(string)` has been added to the `OpenIddictApplicationModel` entity. +3. The `JsonWebKeySet`([JsonWebKeySet](https://learn.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.tokens.jsonwebkeyset)) has been added to the `OpenIddictApplicationModel` entity. +4. The `Settings(string)` has been added to the `OpenIddictApplicationModel` entity. + +## OpenIddictApplicationDescriptor changes + +You have to change the `Type` to `ClientType` when creating a new `AbpApplicationDescriptor` or `OpenIddictApplicationDescriptor`. + +````csharp +var application = new AbpApplicationDescriptor { + ClientId = name, +- Type = type, ++ ClientType = type, + ClientSecret = secret, + ConsentType = consentType, + DisplayName = displayName, +```` + +## OpenIddict Pro module UI changes + +You can change the `ApplicationType` when creating/editing a OpenIddict's application, also set time life of the tokens for each application. + +![ropeniddict-pro-application-modal](images/openiddict-pro-application-modal.png) +![openiddict-pro-application-timelife-modal](images/openiddict-pro-application-timelife-modal.png) diff --git a/docs/en/Migration-Guides/images/openiddict-pro-application-modal.png b/docs/en/Migration-Guides/images/openiddict-pro-application-modal.png new file mode 100644 index 0000000000..10fe722053 Binary files /dev/null and b/docs/en/Migration-Guides/images/openiddict-pro-application-modal.png differ diff --git a/docs/en/Migration-Guides/images/openiddict-pro-application-timelife-modal.png b/docs/en/Migration-Guides/images/openiddict-pro-application-timelife-modal.png new file mode 100644 index 0000000000..b951c1f93d Binary files /dev/null and b/docs/en/Migration-Guides/images/openiddict-pro-application-timelife-modal.png differ diff --git a/modules/openiddict/app/OpenIddict.Demo.API/Program.cs b/modules/openiddict/app/OpenIddict.Demo.API/Program.cs index 9fe034cecf..c40a46ad60 100644 --- a/modules/openiddict/app/OpenIddict.Demo.API/Program.cs +++ b/modules/openiddict/app/OpenIddict.Demo.API/Program.cs @@ -1,11 +1,19 @@ -using System.Text; using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.IdentityModel.Tokens; var builder = WebApplication.CreateBuilder(args); builder.Logging.ClearProviders(); builder.Logging.AddConsole(); +builder.Services.AddCors(options => +{ + options.AddDefaultPolicy(policy => + { + policy.WithOrigins("https://localhost:44304") + .AllowAnyHeader() + .AllowAnyMethod(); + }); +}); + // Add services to the container. builder.Services.AddControllers(); @@ -31,6 +39,7 @@ if (app.Environment.IsDevelopment()) app.UseHttpsRedirection(); +app.UseCors(); app.UseAuthentication(); app.UseAuthorization(); diff --git a/modules/openiddict/app/OpenIddict.Demo.Client.BlazorWASM/Pages/Index.razor b/modules/openiddict/app/OpenIddict.Demo.Client.BlazorWASM/Pages/Index.razor index a2f0e6eb76..7889736c35 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Client.BlazorWASM/Pages/Index.razor +++ b/modules/openiddict/app/OpenIddict.Demo.Client.BlazorWASM/Pages/Index.razor @@ -1,7 +1,11 @@ @page "/" @using System.Security.Claims +@using System.Text.Json +@using Microsoft.AspNetCore.Components.WebAssembly.Authentication +@using System.Net.Http.Headers @inject AuthenticationStateProvider AuthenticationStateProvider +@inject IAccessTokenProvider AccessTokenProvider Index @@ -17,14 +21,31 @@ Welcome to your new app. @if (_claims.Count() > 0) { +

+ @_accessToken +

+
    @foreach (var claim in _claims) {
  • @claim.Type: @claim.Value
  • }
-} + + @{ + var apiResponse = "No API response"; + if (_claimsResponseString != null) + { + apiResponse = JsonSerializer.Serialize(JsonDocument.Parse(_claimsResponseString), new JsonSerializerOptions + { + WriteIndented = true + }); + } + } + @apiResponse; + +} @code { @@ -35,6 +56,8 @@ Welcome to your new app. } private IEnumerable _claims = Enumerable.Empty(); + private string? _accessToken; + private string? _claimsResponseString; private async Task GetClaimsPrincipalData() { @@ -43,8 +66,16 @@ Welcome to your new app. if (user.Identity.IsAuthenticated) { - _claims = user.Claims; + + var result = await AccessTokenProvider.RequestAccessToken(); + result.TryGetToken(out var token); + _accessToken = token?.Value; + + var client = new HttpClient(); + var request = new HttpRequestMessage(HttpMethod.Get, "https://localhost:44303/api/claims"); + request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _accessToken); + _claimsResponseString = await (await client.SendAsync(request)).Content.ReadAsStringAsync(); } } } diff --git a/modules/openiddict/app/OpenIddict.Demo.Client.BlazorWASM/Program.cs b/modules/openiddict/app/OpenIddict.Demo.Client.BlazorWASM/Program.cs index 9995224252..f4a96ba0f8 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Client.BlazorWASM/Program.cs +++ b/modules/openiddict/app/OpenIddict.Demo.Client.BlazorWASM/Program.cs @@ -21,6 +21,7 @@ builder.Services.AddOidcAuthentication(options => options.ProviderOptions.DefaultScopes.Add("roles"); options.ProviderOptions.DefaultScopes.Add("email"); options.ProviderOptions.DefaultScopes.Add("phone"); + options.ProviderOptions.DefaultScopes.Add("AbpAPI"); }); await builder.Build().RunAsync(); diff --git a/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Index.cshtml b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Index.cshtml index ca7e62a411..51646646d1 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Index.cshtml +++ b/modules/openiddict/app/OpenIddict.Demo.Client.Mvc/Pages/Index.cshtml @@ -45,24 +45,5 @@ } @apiResponse; - - request = new HttpRequestMessage(HttpMethod.Get, "https://localhost:44301/api/claims"); - request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", await HttpContext.GetTokenAsync("access_token")); - - response = await client.SendAsync(request); - - - @{ - apiResponse = response.StatusCode.ToString(); - if (response.IsSuccessStatusCode) - { - apiResponse = JsonSerializer.Serialize(JsonDocument.Parse(await response.Content.ReadAsStringAsync()), new JsonSerializerOptions - { - WriteIndented = true - }); - } - } - @apiResponse; - } diff --git a/modules/openiddict/app/OpenIddict.Demo.Server/EntityFrameworkCore/ServerDataSeedContributor.cs b/modules/openiddict/app/OpenIddict.Demo.Server/EntityFrameworkCore/ServerDataSeedContributor.cs index bf6a9cdb15..f63137a0e2 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Server/EntityFrameworkCore/ServerDataSeedContributor.cs +++ b/modules/openiddict/app/OpenIddict.Demo.Server/EntityFrameworkCore/ServerDataSeedContributor.cs @@ -47,8 +47,10 @@ public class ServerDataSeedContributor : IDataSeedContributor, ITransientDepende { await _applicationManager.CreateAsync(new OpenIddictApplicationDescriptor { + ApplicationType = OpenIddictConstants.ApplicationTypes.Web, ClientId = "AbpApp", ClientSecret = "1q2w3e*", + ClientType = OpenIddictConstants.ClientTypes.Confidential, ConsentType = OpenIddictConstants.ConsentTypes.Explicit, DisplayName = "Abp Application", PostLogoutRedirectUris = @@ -93,6 +95,11 @@ public class ServerDataSeedContributor : IDataSeedContributor, ITransientDepende OpenIddictConstants.Permissions.Scopes.Address, OpenIddictConstants.Permissions.Scopes.Phone, OpenIddictConstants.Permissions.Prefixes.Scope + "AbpAPI" + }, + Settings = + { + // Use a shorter access token lifetime for tokens issued to the Postman application. + [OpenIddictConstants.Settings.TokenLifetimes.AccessToken] = TimeSpan.FromMinutes(5).ToString("c", CultureInfo.InvariantCulture) } }); } @@ -101,7 +108,9 @@ public class ServerDataSeedContributor : IDataSeedContributor, ITransientDepende { await _applicationManager.CreateAsync(new OpenIddictApplicationDescriptor { + ApplicationType = OpenIddictConstants.ApplicationTypes.Web, ClientId = "AbpBlazorWASMApp", + ClientType = OpenIddictConstants.ClientTypes.Public, ConsentType = OpenIddictConstants.ConsentTypes.Explicit, DisplayName = "Abp Blazor WASM Application", PostLogoutRedirectUris = diff --git a/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231116094249_Initial.Designer.cs b/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231207053813_Initial.Designer.cs similarity index 99% rename from modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231116094249_Initial.Designer.cs rename to modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231207053813_Initial.Designer.cs index a946b38999..a7a1b7a5b4 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231116094249_Initial.Designer.cs +++ b/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231207053813_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace OpenIddict.Demo.Server.Migrations { [DbContext(typeof(ServerDbContext))] - [Migration("20231116094249_Initial")] + [Migration("20231207053813_Initial")] partial class Initial { /// @@ -818,6 +818,10 @@ namespace OpenIddict.Demo.Server.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -825,6 +829,10 @@ namespace OpenIddict.Demo.Server.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -872,6 +880,9 @@ namespace OpenIddict.Demo.Server.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -898,9 +909,8 @@ namespace OpenIddict.Demo.Server.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231116094249_Initial.cs b/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231207053813_Initial.cs similarity index 99% rename from modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231116094249_Initial.cs rename to modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231207053813_Initial.cs index 89de930745..43e69e2d57 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231116094249_Initial.cs +++ b/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231207053813_Initial.cs @@ -340,17 +340,20 @@ namespace OpenIddict.Demo.Server.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), + ApplicationType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), ClientSecret = table.Column(type: "nvarchar(max)", nullable: true), + ClientType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), DisplayName = table.Column(type: "nvarchar(max)", nullable: true), DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), + JsonWebKeySet = table.Column(type: "nvarchar(max)", nullable: true), Permissions = table.Column(type: "nvarchar(max)", nullable: true), PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Properties = table.Column(type: "nvarchar(max)", nullable: true), RedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Requirements = table.Column(type: "nvarchar(max)", nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Settings = table.Column(type: "nvarchar(max)", nullable: true), ClientUri = table.Column(type: "nvarchar(max)", nullable: true), LogoUri = table.Column(type: "nvarchar(max)", nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), diff --git a/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/ServerDbContextModelSnapshot.cs b/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/ServerDbContextModelSnapshot.cs index dcd97f6304..2ff52d58d5 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/ServerDbContextModelSnapshot.cs +++ b/modules/openiddict/app/OpenIddict.Demo.Server/Migrations/ServerDbContextModelSnapshot.cs @@ -815,6 +815,10 @@ namespace OpenIddict.Demo.Server.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -822,6 +826,10 @@ namespace OpenIddict.Demo.Server.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -869,6 +877,9 @@ namespace OpenIddict.Demo.Server.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -895,9 +906,8 @@ namespace OpenIddict.Demo.Server.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/modules/openiddict/app/OpenIddict.Demo.Server/wwwroot/libs/abp/jquery/abp.jquery.js b/modules/openiddict/app/OpenIddict.Demo.Server/wwwroot/libs/abp/jquery/abp.jquery.js index 942bddd39e..9137fcc989 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Server/wwwroot/libs/abp/jquery/abp.jquery.js +++ b/modules/openiddict/app/OpenIddict.Demo.Server/wwwroot/libs/abp/jquery/abp.jquery.js @@ -371,13 +371,18 @@ var abp = abp || {}; }; var _loadScript = function (url, loadCallback, failCallback) { + var nonce = document.body.nonce || document.body.getAttribute('nonce'); _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { $.get({ url: url, dataType: 'text' }) .done(function (script) { - $.globalEval(script); + if(nonce){ + $.globalEval(script, { nonce: nonce}); + }else{ + $.globalEval(script); + } urlInfo.succeed(); }) .fail(function () { diff --git a/modules/openiddict/app/OpenIddict.Demo.Server/yarn.lock b/modules/openiddict/app/OpenIddict.Demo.Server/yarn.lock index 9a20d73eef..9f48860d42 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Server/yarn.lock +++ b/modules/openiddict/app/OpenIddict.Demo.Server/yarn.lock @@ -2,39 +2,39 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-7.0.0.tgz#b61845e6c2d7486575ab0fd177e7c87005f51d54" - integrity sha512-T4rhCG+O3agwD0pt7m/977ID8Hm0ME9zlqyHIQWiIIaRbicmgblr3OY5szv0C5ttCTUsjzeYlxtcv7I+7SXcaA== - dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "~7.0.0" - -"@abp/aspnetcore.mvc.ui.theme.shared@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-7.0.0.tgz#d2c2785dfe0e482677a38d19f40399eddc246a3b" - integrity sha512-LNetkktN3cMuo28bTrKKC0qYo4vo6OKxWTSGX7tXI9uyd0fPHupwQSh5cNzrJ6KZjNLxINn6MphWiSbcTRYLZw== - dependencies: - "@abp/aspnetcore.mvc.ui" "~7.0.0" - "@abp/bootstrap" "~7.0.0" - "@abp/bootstrap-datepicker" "~7.0.0" - "@abp/bootstrap-daterangepicker" "~7.0.0" - "@abp/datatables.net-bs5" "~7.0.0" - "@abp/font-awesome" "~7.0.0" - "@abp/jquery-form" "~7.0.0" - "@abp/jquery-validation-unobtrusive" "~7.0.0" - "@abp/lodash" "~7.0.0" - "@abp/luxon" "~7.0.0" - "@abp/malihu-custom-scrollbar-plugin" "~7.0.0" - "@abp/moment" "~7.0.0" - "@abp/select2" "~7.0.0" - "@abp/sweetalert2" "~7.0.0" - "@abp/timeago" "~7.0.0" - "@abp/toastr" "~7.0.0" - -"@abp/aspnetcore.mvc.ui@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-7.0.0.tgz#9b55260d41c3dc0f94c6210b88ed8cdb549fea05" - integrity sha512-Ualz90DAgixUOV/B4xoQuGpSfpyDp8vsxB/56qnHcWtbHqdI9lEjdmZstH2CwV6Ey6vIDNMlPR3azbQlEkwslg== +"@abp/aspnetcore.mvc.ui.theme.basic@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/aspnetcore.mvc.ui.theme.basic/-/@abp/aspnetcore.mvc.ui.theme.basic-8.0.0-rc.2.tgz#ff10cf70d483fd12304e463ef240c113fceb2bb3" + integrity sha1-/xDPcNSD/RIwTkY+8kDBE/zrK7M= + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~8.0.0-rc.2" + +"@abp/aspnetcore.mvc.ui.theme.shared@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/aspnetcore.mvc.ui.theme.shared/-/@abp/aspnetcore.mvc.ui.theme.shared-8.0.0-rc.2.tgz#db570c960ad1b250292a0211317634fbeb762a52" + integrity sha1-21cMlgrRslApKgIRMXY0++t2KlI= + dependencies: + "@abp/aspnetcore.mvc.ui" "~8.0.0-rc.2" + "@abp/bootstrap" "~8.0.0-rc.2" + "@abp/bootstrap-datepicker" "~8.0.0-rc.2" + "@abp/bootstrap-daterangepicker" "~8.0.0-rc.2" + "@abp/datatables.net-bs5" "~8.0.0-rc.2" + "@abp/font-awesome" "~8.0.0-rc.2" + "@abp/jquery-form" "~8.0.0-rc.2" + "@abp/jquery-validation-unobtrusive" "~8.0.0-rc.2" + "@abp/lodash" "~8.0.0-rc.2" + "@abp/luxon" "~8.0.0-rc.2" + "@abp/malihu-custom-scrollbar-plugin" "~8.0.0-rc.2" + "@abp/moment" "~8.0.0-rc.2" + "@abp/select2" "~8.0.0-rc.2" + "@abp/sweetalert2" "~8.0.0-rc.2" + "@abp/timeago" "~8.0.0-rc.2" + "@abp/toastr" "~8.0.0-rc.2" + +"@abp/aspnetcore.mvc.ui@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/aspnetcore.mvc.ui/-/@abp/aspnetcore.mvc.ui-8.0.0-rc.2.tgz#57099c3064f462713940a1d40fbddfe7b14510eb" + integrity sha1-VwmcMGT0YnE5QKHUD73f57FFEOs= dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -43,160 +43,160 @@ merge-stream "^2.0.0" micromatch "^4.0.2" -"@abp/bootstrap-datepicker@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-7.0.0.tgz#7d83206c7a496addd9136ebd08635fd55e88e004" - integrity sha512-IBr1lyptW1w8E34yDfx8UcY/9QhWn54X+p1VsVi5vNsabIw/eV2cizfU200w7qdWRENJxWR2rCbvPAvfB79erA== +"@abp/bootstrap-datepicker@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/bootstrap-datepicker/-/@abp/bootstrap-datepicker-8.0.0-rc.2.tgz#85e41ff35b7306040e0dfdaabc04c9dec280ae0f" + integrity sha1-heQf81tzBgQODf2qvATJ3sKArg8= dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap-daterangepicker@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-daterangepicker/-/bootstrap-daterangepicker-7.0.0.tgz#8bbbbb5696edbe9dfb02c5057e5aaf0b1e4b3296" - integrity sha512-+dWOj3H5rerpt1JMIWeSEjWh2WkJxYy944BBO42G0TYVghrWFSZkpu3HQTJu4hc/WSEFcHBbE5DmbGmg8tSpvA== +"@abp/bootstrap-daterangepicker@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/bootstrap-daterangepicker/-/@abp/bootstrap-daterangepicker-8.0.0-rc.2.tgz#9380b4e29c69fe8ecec4877c9bbe443857e2e902" + integrity sha1-k4C04pxp/o7OxId8m75EOFfi6QI= dependencies: bootstrap-daterangepicker "^3.1.0" -"@abp/bootstrap@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-7.0.0.tgz#f28bf80bf0422c726a563588ed07697d0c990ec9" - integrity sha512-7u6x8hPf4ldpoxpVYZrIvo9AvVdUQdASaDWXgYiuIjgR+xvnVwD1cWI/jzAhKLnnVXfCpv9pcUYp6bfyCHpO8g== +"@abp/bootstrap@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/bootstrap/-/@abp/bootstrap-8.0.0-rc.2.tgz#9d36df7aa5b78ada6739633dabedf0c05fdedbde" + integrity sha1-nTbfeqW3itpnOWM9q+3wwF/e294= dependencies: - "@abp/core" "~7.0.0" + "@abp/core" "~8.0.0-rc.2" bootstrap "^5.1.3" -"@abp/core@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-7.0.0.tgz#f2f62ea826563cb7498dff1534f2e87a875002e4" - integrity sha512-I9V+amo8a4eYlKeMV6fxb+2uvBLZkuJv78IRilmL6jOxg5F9mJuvPzg7XQugMnDQ9NZXErjDW04DyR/5OfeIiA== +"@abp/core@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/core/-/@abp/core-8.0.0-rc.2.tgz#6167929da30563b3b2f1938be40648bd08db61af" + integrity sha1-YWeSnaMFY7Oy8ZOL5AZIvQjbYa8= dependencies: - "@abp/utils" "~7.0.0" + "@abp/utils" "~8.0.0-rc.2" -"@abp/datatables.net-bs5@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-7.0.0.tgz#f85e62d8f634dd0493f6e0bf093b43b1a83ccd1c" - integrity sha512-yul58rrMylQJUJS4aUZNpm85dLbU1IF84LESAqFKrRST0v3uK3/qXdXgir2XQt0cuOv33rQIrljKRovxxv57zA== +"@abp/datatables.net-bs5@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/datatables.net-bs5/-/@abp/datatables.net-bs5-8.0.0-rc.2.tgz#a5d36298ad7ddb59dc66917eeb10f3898d4f6e39" + integrity sha1-pdNimK1921ncZpF+6xDziY1Pbjk= dependencies: - "@abp/datatables.net" "~7.0.0" + "@abp/datatables.net" "~8.0.0-rc.2" datatables.net-bs5 "^1.11.4" -"@abp/datatables.net@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-7.0.0.tgz#d6b0557695070a3fdb939e4f3c6593a092881081" - integrity sha512-vETe0eUB5LXQP3oHdwjMibXYFcXmwjkZea3ZoCHH9IG/gLmmrr0zM8yQHwRJvJv+wkxUtp2cWwcMMLFmK5o2Aw== +"@abp/datatables.net@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/datatables.net/-/@abp/datatables.net-8.0.0-rc.2.tgz#267dcb7a49b708af83de3dfbdeb2f42617d46708" + integrity sha1-Jn3Lekm3CK+D3j373rL0JhfUZwg= dependencies: - "@abp/jquery" "~7.0.0" + "@abp/jquery" "~8.0.0-rc.2" datatables.net "^1.11.4" -"@abp/font-awesome@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-7.0.0.tgz#938f4e4cf3d46e0ec45fc60f568519f4df7221a3" - integrity sha512-UXiO/y9yrguhvev8BmFEKzdek0wMC25IwppMOsVmxtv/SiCRUsHGIzyTVs1ZLuvlL94cuxxqfIHrQrat423/0g== +"@abp/font-awesome@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/font-awesome/-/@abp/font-awesome-8.0.0-rc.2.tgz#2c7f392d4a7971f34ef6fa2835901183b2731976" + integrity sha1-LH85LUp5cfNO9vooNZARg7JzGXY= dependencies: - "@abp/core" "~7.0.0" + "@abp/core" "~8.0.0-rc.2" "@fortawesome/fontawesome-free" "^5.15.4" -"@abp/jquery-form@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-7.0.0.tgz#86a051c9d98b51ce70d15ee578cf4f5d9c628030" - integrity sha512-nm89ufHtO+QFaVZ+TwihuWgmEpxhaFoUUbuD7Plzt3PpFWeGet722yTma7MUr10FUTIshOiBBWJ84+ak+CMqgA== +"@abp/jquery-form@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/jquery-form/-/@abp/jquery-form-8.0.0-rc.2.tgz#45e2a3d838ed8c2b3f59aa6eb6f62b2e7a5934fa" + integrity sha1-ReKj2DjtjCs/WaputvYrLnpZNPo= dependencies: - "@abp/jquery" "~7.0.0" + "@abp/jquery" "~8.0.0-rc.2" jquery-form "^4.3.0" -"@abp/jquery-validation-unobtrusive@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-7.0.0.tgz#5049fc367ed8ed7b0faff63b89a7eee1619afaf9" - integrity sha512-B8OPreI05utq3IPyU+/713e0c35OjQrS5OKO7dZs1D6V9L6S/VzkeD3sdoVJQ0Syh59KcSr3IGr1F9VM1O0LJw== +"@abp/jquery-validation-unobtrusive@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/jquery-validation-unobtrusive/-/@abp/jquery-validation-unobtrusive-8.0.0-rc.2.tgz#c6a4e3081f1d7eadff34592b8cf0498db40170a0" + integrity sha1-xqTjCB8dfq3/NFkrjPBJjbQBcKA= dependencies: - "@abp/jquery-validation" "~7.0.0" + "@abp/jquery-validation" "~8.0.0-rc.2" jquery-validation-unobtrusive "^3.2.12" -"@abp/jquery-validation@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-7.0.0.tgz#eebadba703391ce6dea1a5217a177af0bafe4f4b" - integrity sha512-6YrYZhVZBTt3897eR0t/b9cQp4gMsiylhe6xqtZBhcuTlS5q0ac30UeiOj9bsBisg4TWS6+3XZYUccdM38YE0Q== +"@abp/jquery-validation@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/jquery-validation/-/@abp/jquery-validation-8.0.0-rc.2.tgz#4282682538c450bffaba2558cbcc8ac9779736b6" + integrity sha1-QoJoJTjEUL/6uiVYy8yKyXeXNrY= dependencies: - "@abp/jquery" "~7.0.0" + "@abp/jquery" "~8.0.0-rc.2" jquery-validation "^1.19.3" -"@abp/jquery@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-7.0.0.tgz#0ec51b53c92bd23100bbbe1f719e7e1c13c41406" - integrity sha512-Gsyl1Bl6ahIv1Sc0y1Zt9iaYeS3HCjx7mxJGMitQiKOmKRNHDX6bOzcUN2tY3CaZ+Q5lgHw9RNehleFF2AasJw== +"@abp/jquery@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/jquery/-/@abp/jquery-8.0.0-rc.2.tgz#e54905bbd5efa13f9a87854608f103e15757a26c" + integrity sha1-5UkFu9XvoT+ah4VGCPED4VdXomw= dependencies: - "@abp/core" "~7.0.0" + "@abp/core" "~8.0.0-rc.2" jquery "~3.6.0" -"@abp/lodash@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-7.0.0.tgz#7086287a6fafee12a44b2c2abc3c9bea4338ebde" - integrity sha512-JbUxeZNB/RYETPxALKuMJ78SeuVxHPXjsl1lv21XrRhOU6SaQMIFMHWL7AlfLjLS/ibbSXHoHM1K/YwkN3zAZQ== +"@abp/lodash@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/lodash/-/@abp/lodash-8.0.0-rc.2.tgz#1bca1821db7524e1c612cfe23319abab5d874453" + integrity sha1-G8oYIdt1JOHGEs/iMxmrq12HRFM= dependencies: - "@abp/core" "~7.0.0" + "@abp/core" "~8.0.0-rc.2" lodash "^4.17.21" -"@abp/luxon@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-7.0.0.tgz#5f781dc826fc1f15af9da52b032f2d4fc1b61c4d" - integrity sha512-zbHZuvkH4F5f0/r2Rfr42k+iNkHlJJKZMCyaCjcDcypLHg/HSsVnpVNjqCrdggSxDgx/7jdf6M3aRIa6hINthA== +"@abp/luxon@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/luxon/-/@abp/luxon-8.0.0-rc.2.tgz#336800a04fd72c42f2b9a00da864a708d0c730c6" + integrity sha1-M2gAoE/XLELyuaANqGSnCNDHMMY= dependencies: - "@abp/core" "~7.0.0" + "@abp/core" "~8.0.0-rc.2" luxon "^2.3.0" -"@abp/malihu-custom-scrollbar-plugin@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-7.0.0.tgz#6d01a2a75d04bb1919a9ef4c6bfb8559fb2a1744" - integrity sha512-S6rlGNtcgFtfyuF2/1yoeA6VWE1a4ChGWll08DAwM9oz4ULU2vsjQCsbcLB3uhgmTKmF0Q7I964AF1Ngc7FfrQ== +"@abp/malihu-custom-scrollbar-plugin@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/malihu-custom-scrollbar-plugin/-/@abp/malihu-custom-scrollbar-plugin-8.0.0-rc.2.tgz#30e7f8fb1edfa921e413f7c166fcac03c9702993" + integrity sha1-MOf4+x7fqSHkE/fBZvysA8lwKZM= dependencies: - "@abp/core" "~7.0.0" + "@abp/core" "~8.0.0-rc.2" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/moment@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/moment/-/moment-7.0.0.tgz#fd5480a0f4e59e6cad7fb7dda1167e75eb9b872d" - integrity sha512-22gWkJgb16DAuq4dqol5gNR1xXkJLXfI30lOOMFhGAuFNlyhQiaZH7tk/pt/wk8+74zi5swdcx42R4C4ioJsMg== +"@abp/moment@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/moment/-/@abp/moment-8.0.0-rc.2.tgz#47e65d9cd7f58d2902da2df584d23d6500c9aa4e" + integrity sha1-R+ZdnNf1jSkC2i31hNI9ZQDJqk4= dependencies: moment "^2.9.0" -"@abp/select2@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-7.0.0.tgz#510b6a281beb10708609308fe8a001ceb294bdbe" - integrity sha512-1LsxnglYz87zus2XLiknmnISq1WB+FOqNVkVEV5B/tgjZxB47QDHlBAsDq+CVSUdHupvyaoqjvzjhepQWn4lXg== +"@abp/select2@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/select2/-/@abp/select2-8.0.0-rc.2.tgz#eab2d8c788490dfb42e164535a2ec0e5341c9463" + integrity sha1-6rLYx4hJDftC4WRTWi7A5TQclGM= dependencies: - "@abp/core" "~7.0.0" + "@abp/core" "~8.0.0-rc.2" select2 "^4.0.13" -"@abp/sweetalert2@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-7.0.0.tgz#0c4ff48755bbc13e00430a5c7107a2d3c0f4ffc6" - integrity sha512-mVFfikx48hnYqQzvmkrYw1pa+ggKkLD+S94U70aEMZE+pqYsVzkPHckFKPqi+iQL265iQ8zTLgeclYCrOsEnrg== +"@abp/sweetalert2@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/sweetalert2/-/@abp/sweetalert2-8.0.0-rc.2.tgz#7c3ca3ffff01a43a3603f49a1986f162157e2a72" + integrity sha1-fDyj//8BpDo2A/SaGYbxYhV+KnI= dependencies: - "@abp/core" "~7.0.0" + "@abp/core" "~8.0.0-rc.2" sweetalert2 "^11.3.6" -"@abp/timeago@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-7.0.0.tgz#b5c0a98511cef63d24d51c531adccc135d12706e" - integrity sha512-Y4PZxP4YVUVIQp8mQtNCxdsK9JxxQj7QJURGVtS+v4bfr6HO9GHK2Byq57ypCdB6hHcn+DJ/NHJV8qANcjHnFA== +"@abp/timeago@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/timeago/-/@abp/timeago-8.0.0-rc.2.tgz#ed98d40b1fa2fa7e65bc3ad84db896e32184a112" + integrity sha1-7ZjUCx+i+n5lvDrYTbiW4yGEoRI= dependencies: - "@abp/jquery" "~7.0.0" + "@abp/jquery" "~8.0.0-rc.2" timeago "^1.6.7" -"@abp/toastr@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-7.0.0.tgz#4704e61aa0ac741dd4a53505533a5278b5c205cb" - integrity sha512-kDd4YkyOInBs1u1enOL6ov8HKUJwZbJ3Dx0GI+UNnl+7/LFboeWBfsGukDTVaCn8U73jEP+wbc98mTe8j2coZA== +"@abp/toastr@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/toastr/-/@abp/toastr-8.0.0-rc.2.tgz#c494bb1070ef6aa80d443d11a61f93c03d82f543" + integrity sha1-xJS7EHDvaqgNRD0Rph+TwD2C9UM= dependencies: - "@abp/jquery" "~7.0.0" + "@abp/jquery" "~8.0.0-rc.2" toastr "^2.1.4" -"@abp/utils@~7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-7.0.0.tgz#662645b8774b048ba5eb6f7971fa1f20b909ad96" - integrity sha512-JLufGsUmZ8jUdZNteXXp/phYqVCiOHO6ymMyd2oUjVEnRh3wRtRs4snhN2MQruGa6KCbPHkjGhXiQTUo75IbaQ== +"@abp/utils@~8.0.0-rc.2": + version "8.0.0-rc.2" + resolved "https://www.myget.org/F/abp-nightly/npm/@abp/utils/-/@abp/utils-8.0.0-rc.2.tgz#c2959e5161e4102d5757a571d16bd3a4316779fb" + integrity sha1-wpWeUWHkEC1XV6Vx0WvTpDFnefs= dependencies: - just-compare "^1.3.0" + just-compare "^2.3.0" "@fortawesome/fontawesome-free@^5.15.4": version "5.15.4" @@ -1439,10 +1439,10 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -just-compare@^1.3.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/just-compare/-/just-compare-1.5.1.tgz#aed7e93e6bae9c3b69d79aea7805684132a0c0c5" - integrity sha512-xDEEFHNIyJNmN4uo/2RVeUcay9THtN/5ka/iw98Y/gsa8w9KXZQuyaf5eFUY6VlntA2+G+bdPmdhqqTs7T+BRw== +just-compare@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/just-compare/-/just-compare-2.3.0.tgz#a2adcc1d1940536263275f5a1ef1298bcacfeda7" + integrity sha512-6shoR7HDT+fzfL3gBahx1jZG3hWLrhPAf+l7nCwahDdT9XDtosB9kIF0ZrzUp5QY8dJWfQVr5rnsPqsbvflDzg== just-debounce@^1.0.0: version "1.1.0" diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/RemoveClaimsFromClientCredentialsGrantType.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/RemoveClaimsFromClientCredentialsGrantType.cs index 8ac866283b..08fdddbaa9 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/RemoveClaimsFromClientCredentialsGrantType.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/RemoveClaimsFromClientCredentialsGrantType.cs @@ -14,7 +14,7 @@ public class RemoveClaimsFromClientCredentialsGrantType : IOpenIddictServerHandl .SetType(OpenIddictServerHandlerType.Custom) .Build(); - public ValueTask HandleAsync(OpenIddictServerEvents.ProcessSignInContext context) + public virtual ValueTask HandleAsync(OpenIddictServerEvents.ProcessSignInContext context) { if (context.Request.IsClientCredentialsGrantType()) { diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Scopes/AttachScopes.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Scopes/AttachScopes.cs index 75401ada2b..d3636b6b1a 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Scopes/AttachScopes.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Scopes/AttachScopes.cs @@ -21,7 +21,7 @@ public class AttachScopes : IOpenIddictServerHandler : IOpenIddictServerHandler +public abstract class AbpOpenIddictWildcardDomainBase : IOpenIddictServerHandler where THandler : class + where TOriginalHandler : class where TContext : OpenIddictServerEvents.BaseContext { - protected THandler Handler { get; set; } + public ILogger Logger { get; set; } + protected TOriginalHandler OriginalHandler { get; set; } protected AbpOpenIddictWildcardDomainOptions WildcardDomainOptions { get; } - protected AbpOpenIddictWildcardDomainBase(IOptions wildcardDomainOptions, THandler handler) + protected AbpOpenIddictWildcardDomainBase(IOptions wildcardDomainOptions, TOriginalHandler originalHandler) { WildcardDomainOptions = wildcardDomainOptions.Value; - Handler = handler; + OriginalHandler = originalHandler; + + Logger = NullLogger.Instance; } public abstract ValueTask HandleAsync(TContext context); protected virtual Task CheckWildcardDomainAsync(string url) { + Logger.LogDebug("Checking wildcard domain for url: {url}", url); + foreach (var domainFormat in WildcardDomainOptions.WildcardDomainsFormat) { + Logger.LogDebug("Checking wildcard domain format: {domainFormat}", domainFormat); var extractResult = FormattedStringValueExtracter.Extract(url, domainFormat, ignoreCase: true); if (extractResult.IsMatch) { + Logger.LogDebug("Wildcard domain found for url: {url}", url); return Task.FromResult(true); } } foreach (var domainFormat in WildcardDomainOptions.WildcardDomainsFormat) { + Logger.LogDebug("Checking wildcard domain format: {domainFormat}", domainFormat); if (domainFormat.Replace("{0}.", "").Equals(url, StringComparison.OrdinalIgnoreCase)) { + Logger.LogDebug("Wildcard domain found for url: {url}", url); return Task.FromResult(true); } } + Logger.LogDebug("Wildcard domain not found for url: {url}", url); return Task.FromResult(false); } } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpOpenIddictWildcardDomainOptions.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpOpenIddictWildcardDomainOptions.cs index 5b0e8f591a..358974e3d6 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpOpenIddictWildcardDomainOptions.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpOpenIddictWildcardDomainOptions.cs @@ -12,5 +12,4 @@ public class AbpOpenIddictWildcardDomainOptions { WildcardDomainsFormat = new HashSet(); } - } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateAuthorizedParty.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateAuthorizedParty.cs index 89ebfee28c..5c22de29a2 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateAuthorizedParty.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateAuthorizedParty.cs @@ -5,12 +5,12 @@ using OpenIddict.Server; namespace Volo.Abp.OpenIddict.WildcardDomains; -public class AbpValidateAuthorizedParty : AbpOpenIddictWildcardDomainBase +public class AbpValidateAuthorizedParty : AbpOpenIddictWildcardDomainBase { public static OpenIddictServerHandlerDescriptor Descriptor { get; } = OpenIddictServerHandlerDescriptor.CreateBuilder() .UseScopedHandler() - .SetOrder(OpenIddictServerHandlers.Session.ValidateToken.Descriptor.Order + 1_000) + .SetOrder(OpenIddictServerHandlers.Session.ValidateEndpointPermissions.Descriptor.Order + 1_000) .SetType(OpenIddictServerHandlerType.BuiltIn) .Build(); @@ -19,7 +19,7 @@ public class AbpValidateAuthorizedParty : AbpOpenIddictWildcardDomainBase +public class AbpValidateClientPostLogoutRedirectUri : AbpOpenIddictWildcardDomainBase { public static OpenIddictServerHandlerDescriptor Descriptor { get; } = OpenIddictServerHandlerDescriptor.CreateBuilder() @@ -21,7 +21,7 @@ public class AbpValidateClientPostLogoutRedirectUri : AbpOpenIddictWildcardDomai IOpenIddictApplicationManager applicationManager) : base(wildcardDomainsOptions, new OpenIddictServerHandlers.Session.ValidateClientPostLogoutRedirectUri(applicationManager)) { - Handler = new OpenIddictServerHandlers.Session.ValidateClientPostLogoutRedirectUri(applicationManager); + OriginalHandler = new OpenIddictServerHandlers.Session.ValidateClientPostLogoutRedirectUri(applicationManager); } public async override ValueTask HandleAsync(OpenIddictServerEvents.ValidateLogoutRequestContext context) @@ -34,6 +34,6 @@ public class AbpValidateClientPostLogoutRedirectUri : AbpOpenIddictWildcardDomai return; } - await Handler.HandleAsync(context); + await OriginalHandler.HandleAsync(context); } } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateClientRedirectUri.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateClientRedirectUri.cs index 739d34b39b..914c6960d3 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateClientRedirectUri.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateClientRedirectUri.cs @@ -5,13 +5,13 @@ using OpenIddict.Server; namespace Volo.Abp.OpenIddict.WildcardDomains; -public class AbpValidateClientRedirectUri : AbpOpenIddictWildcardDomainBase +public class AbpValidateClientRedirectUri : AbpOpenIddictWildcardDomainBase { public static OpenIddictServerHandlerDescriptor Descriptor { get; } = OpenIddictServerHandlerDescriptor.CreateBuilder() .AddFilter() .UseScopedHandler() - .SetOrder(OpenIddictServerHandlers.Authentication.ValidateClientType.Descriptor.Order + 1_000) + .SetOrder(OpenIddictServerHandlers.Authentication.ValidateResponseType.Descriptor.Order + 1_000) .SetType(OpenIddictServerHandlerType.BuiltIn) .Build(); @@ -20,7 +20,7 @@ public class AbpValidateClientRedirectUri : AbpOpenIddictWildcardDomainBase +public class AbpValidatePostLogoutRedirectUriParameter : AbpOpenIddictWildcardDomainBase { public static OpenIddictServerHandlerDescriptor Descriptor { get; } = OpenIddictServerHandlerDescriptor.CreateBuilder() @@ -14,7 +14,7 @@ public class AbpValidatePostLogoutRedirectUriParameter : AbpOpenIddictWildcardDo .Build(); public AbpValidatePostLogoutRedirectUriParameter(IOptions wildcardDomainsOptions) - : base(wildcardDomainsOptions, new OpenIddictServerHandlers.Session.ValidatePostLogoutRedirectUriParameter()) + : base(wildcardDomainsOptions, new OpenIddictServerHandlers.Session.ValidatePostLogoutRedirectUriParameter()) { } @@ -27,6 +27,6 @@ public class AbpValidatePostLogoutRedirectUriParameter : AbpOpenIddictWildcardDo return; } - await Handler.HandleAsync(context); + await OriginalHandler.HandleAsync(context); } } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateRedirectUriParameter.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateRedirectUriParameter.cs index 3bac84e2c4..cc52e3d2b0 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateRedirectUriParameter.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/WildcardDomains/AbpValidateRedirectUriParameter.cs @@ -4,7 +4,7 @@ using OpenIddict.Server; namespace Volo.Abp.OpenIddict.WildcardDomains; -public class AbpValidateRedirectUriParameter : AbpOpenIddictWildcardDomainBase +public class AbpValidateRedirectUriParameter : AbpOpenIddictWildcardDomainBase { public static OpenIddictServerHandlerDescriptor Descriptor { get; } = OpenIddictServerHandlerDescriptor.CreateBuilder() @@ -27,6 +27,6 @@ public class AbpValidateRedirectUriParameter : AbpOpenIddictWildcardDomainBase CountAsync(CancellationToken cancellationToken) + public virtual async ValueTask CountAsync(CancellationToken cancellationToken) { return await Repository.GetCountAsync(cancellationToken); } - public ValueTask CountAsync(Func, IQueryable> query, CancellationToken cancellationToken) + public virtual ValueTask CountAsync(Func, IQueryable> query, CancellationToken cancellationToken) { throw new NotSupportedException(); } - public async ValueTask CreateAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual async ValueTask CreateAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); @@ -52,7 +53,7 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase FindByIdAsync(string identifier, CancellationToken cancellationToken) + public virtual async ValueTask FindByIdAsync(string identifier, CancellationToken cancellationToken) { Check.NotNullOrEmpty(identifier, nameof(identifier)); return (await Repository.FindAsync(ConvertIdentifierFromString(identifier), cancellationToken: cancellationToken)).ToModel(); } - public async ValueTask FindByClientIdAsync(string identifier, CancellationToken cancellationToken) + public virtual async ValueTask FindByClientIdAsync(string identifier, CancellationToken cancellationToken) { Check.NotNullOrEmpty(identifier, nameof(identifier)); return (await Repository.FindByClientIdAsync(identifier, cancellationToken: cancellationToken)).ToModel(); } - public async IAsyncEnumerable FindByPostLogoutRedirectUriAsync(string uris, [EnumeratorCancellation] CancellationToken cancellationToken) + public virtual async IAsyncEnumerable FindByPostLogoutRedirectUriAsync(string uris, [EnumeratorCancellation] CancellationToken cancellationToken) { Check.NotNullOrEmpty(uris, nameof(uris)); @@ -105,7 +106,7 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase FindByRedirectUriAsync(string uri, [EnumeratorCancellation] CancellationToken cancellationToken) + public virtual async IAsyncEnumerable FindByRedirectUriAsync(string uri, [EnumeratorCancellation] CancellationToken cancellationToken) { Check.NotNullOrEmpty(uri, nameof(uri)); @@ -120,46 +121,53 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken) + public virtual ValueTask GetApplicationTypeAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + { + Check.NotNull(application, nameof(application)); + + return new ValueTask(application.ApplicationType); + } + + public virtual ValueTask GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken) { throw new NotSupportedException(); } - public ValueTask GetClientIdAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask GetClientIdAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); return new ValueTask(application.ClientId); } - public ValueTask GetClientSecretAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask GetClientSecretAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); return new ValueTask(application.ClientSecret); } - public ValueTask GetClientTypeAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask GetClientTypeAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); - return new ValueTask(application.Type); + return new ValueTask(application.ClientType); } - public ValueTask GetConsentTypeAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask GetConsentTypeAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); return new ValueTask(application.ConsentType); } - public ValueTask GetDisplayNameAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask GetDisplayNameAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); return new ValueTask(application.DisplayName); } - public ValueTask> GetDisplayNamesAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask> GetDisplayNamesAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); @@ -187,14 +195,21 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase GetIdAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask GetIdAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); return new ValueTask(ConvertIdentifierToString(application.Id)); } - public ValueTask> GetPermissionsAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask GetJsonWebKeySetAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + { + Check.NotNull(application, nameof(application)); + + return new ValueTask(application.JsonWebKeySet); + } + + public virtual ValueTask> GetPermissionsAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); @@ -222,7 +237,7 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase> GetPostLogoutRedirectUrisAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask> GetPostLogoutRedirectUrisAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); @@ -250,7 +265,7 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase> GetPropertiesAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask> GetPropertiesAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); @@ -271,7 +286,7 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase> GetRedirectUrisAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask> GetRedirectUrisAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); @@ -299,7 +314,7 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase> GetRequirementsAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + public virtual ValueTask> GetRequirementsAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); @@ -327,7 +342,35 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase InstantiateAsync(CancellationToken cancellationToken) + public virtual ValueTask> GetSettingsAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) + { + Check.NotNull(application, nameof(application)); + + if (string.IsNullOrEmpty(application.Settings)) + { + return new ValueTask>(ImmutableDictionary.Create()); + } + + using (var document = JsonDocument.Parse(application.Settings)) + { + var builder = ImmutableDictionary.CreateBuilder(); + + foreach (var property in document.RootElement.EnumerateObject()) + { + var value = property.Value.GetString(); + if (string.IsNullOrEmpty(value)) + { + continue; + } + + builder[property.Name] = value; + } + + return new ValueTask>(builder.ToImmutable()); + } + } + + public virtual ValueTask InstantiateAsync(CancellationToken cancellationToken) { return new ValueTask(new OpenIddictApplicationModel { @@ -335,7 +378,7 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase ListAsync(int? count, int? offset, [EnumeratorCancellation] CancellationToken cancellationToken) + public virtual async IAsyncEnumerable ListAsync(int? count, int? offset, [EnumeratorCancellation] CancellationToken cancellationToken) { var applications = await Repository.ListAsync(count, offset, cancellationToken); foreach (var application in applications) @@ -344,11 +387,19 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase ListAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken) + public virtual IAsyncEnumerable ListAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken) { throw new NotSupportedException(); } + public virtual ValueTask SetApplicationTypeAsync(OpenIddictApplicationModel application, string type, CancellationToken cancellationToken) + { + Check.NotNull(application, nameof(application)); + + application.ApplicationType = type; + return default; + } + public virtual ValueTask SetClientIdAsync(OpenIddictApplicationModel application, string identifier, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); @@ -369,7 +420,7 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase permissions, CancellationToken cancellationToken) { @@ -534,6 +593,30 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase settings, CancellationToken cancellationToken) + { + Check.NotNull(application, nameof(application)); + + if (settings.IsEmpty) + { + application.Settings = null; + return default; + } + + application.Settings = WriteStream(writer => + { + writer.WriteStartObject(); + foreach (var setting in settings) + { + writer.WritePropertyName(setting.Key); + writer.WriteStringValue(setting.Value); + } + writer.WriteEndObject(); + }); + + return default; + } + public virtual async ValueTask UpdateAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken) { Check.NotNull(application, nameof(application)); diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplication.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplication.cs index 6098f67392..e88370e874 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplication.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplication.cs @@ -14,6 +14,11 @@ public class OpenIddictApplication : FullAuditedAggregateRoot { } + /// + /// Gets or sets the application type associated with the application. + /// + public virtual string ApplicationType { get; set; } + /// /// Gets or sets the client identifier associated with the current application. /// @@ -26,6 +31,11 @@ public class OpenIddictApplication : FullAuditedAggregateRoot /// public virtual string ClientSecret { get; set; } + /// + /// Gets or sets the client type associated with the application. + /// + public string ClientType { get; set; } + /// /// Gets or sets the consent type associated with the current application. /// @@ -43,6 +53,12 @@ public class OpenIddictApplication : FullAuditedAggregateRoot /// public virtual string DisplayNames { get; set; } + /// + /// Gets or sets the JSON Web Key Set associated with + /// the application, serialized as a JSON object. + /// + public virtual string JsonWebKeySet { get; set; } + /// /// Gets or sets the permissions associated with the /// current application, serialized as a JSON array. @@ -74,9 +90,9 @@ public class OpenIddictApplication : FullAuditedAggregateRoot public virtual string Requirements { get; set; } /// - /// Gets or sets the application type associated with the current application. + /// Gets or sets the settings serialized as a JSON object. /// - public virtual string Type { get; set; } + public virtual string Settings { get; set; } /// /// URI to further information about client. diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationExtensions.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationExtensions.cs index 34ff4ba41f..791136316a 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationExtensions.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationExtensions.cs @@ -1,4 +1,9 @@ -namespace Volo.Abp.OpenIddict.Applications; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Text.Json; +using Microsoft.IdentityModel.Tokens; + +namespace Volo.Abp.OpenIddict.Applications; public static class OpenIddictApplicationExtensions { @@ -8,17 +13,20 @@ public static class OpenIddictApplicationExtensions var entity = new OpenIddictApplication(model.Id) { + ApplicationType = model.ApplicationType, ClientId = model.ClientId, ClientSecret = model.ClientSecret, + ClientType = model.ClientType, ConsentType = model.ConsentType, DisplayName = model.DisplayName, DisplayNames = model.DisplayNames, + JsonWebKeySet = model.JsonWebKeySet != null ? JsonSerializer.Serialize(model.JsonWebKeySet) : null, Permissions = model.Permissions, PostLogoutRedirectUris = model.PostLogoutRedirectUris, Properties = model.Properties, RedirectUris = model.RedirectUris, Requirements = model.Requirements, - Type = model.Type, + Settings = model.Settings, ClientUri = model.ClientUri, LogoUri = model.LogoUri }; @@ -37,17 +45,20 @@ public static class OpenIddictApplicationExtensions Check.NotNull(model, nameof(model)); Check.NotNull(entity, nameof(entity)); + entity.ApplicationType = model.ApplicationType; entity.ClientId = model.ClientId; entity.ClientSecret = model.ClientSecret; entity.ConsentType = model.ConsentType; + entity.ClientType = model.ClientType; entity.DisplayName = model.DisplayName; entity.DisplayNames = model.DisplayNames; + entity.JsonWebKeySet = model.JsonWebKeySet != null ? JsonSerializer.Serialize(model.JsonWebKeySet) : null; entity.Permissions = model.Permissions; entity.PostLogoutRedirectUris = model.PostLogoutRedirectUris; entity.Properties = model.Properties; entity.RedirectUris = model.RedirectUris; entity.Requirements = model.Requirements; - entity.Type = model.Type; + entity.Settings = model.Settings; entity.ClientUri = model.ClientUri; entity.LogoUri = model.LogoUri; @@ -60,6 +71,11 @@ public static class OpenIddictApplicationExtensions return entity; } + /// + /// parsing the stringified JSON Web Key Set is an expensive operation, To mitigate that, the resulting object is stored in the static cache. + /// + private readonly static ConcurrentDictionary JsonWebKeySetCache = new ConcurrentDictionary(); + public static OpenIddictApplicationModel ToModel(this OpenIddictApplication entity) { if(entity == null) @@ -70,17 +86,20 @@ public static class OpenIddictApplicationExtensions var model = new OpenIddictApplicationModel { Id = entity.Id, + ApplicationType = entity.ApplicationType, ClientId = entity.ClientId, ClientSecret = entity.ClientSecret, + ClientType = entity.ClientType, ConsentType = entity.ConsentType, DisplayName = entity.DisplayName, DisplayNames = entity.DisplayNames, + JsonWebKeySet = entity.JsonWebKeySet != null ? JsonWebKeySetCache.GetOrAdd(entity.JsonWebKeySet, () => JsonWebKeySet.Create(entity.JsonWebKeySet)) : null, Permissions = entity.Permissions, PostLogoutRedirectUris = entity.PostLogoutRedirectUris, Properties = entity.Properties, RedirectUris = entity.RedirectUris, Requirements = entity.Requirements, - Type = entity.Type, + Settings = entity.Settings, ClientUri = entity.ClientUri, LogoUri = entity.LogoUri }; diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationModel.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationModel.cs index ff13ef2355..48a376769f 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationModel.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationModel.cs @@ -1,4 +1,5 @@ using System; +using Microsoft.IdentityModel.Tokens; using Volo.Abp.MultiTenancy; using Volo.Abp.ObjectExtending; @@ -9,6 +10,11 @@ public class OpenIddictApplicationModel : ExtensibleObject { public Guid Id { get; set; } + /// + /// Gets or sets the application type associated with the application. + /// + public virtual string ApplicationType { get; set; } + /// /// Gets or sets the client identifier associated with the current application. /// @@ -21,6 +27,11 @@ public class OpenIddictApplicationModel : ExtensibleObject /// public virtual string ClientSecret { get; set; } + /// + /// Gets or sets the client type associated with the application. + /// + public string ClientType { get; set; } + /// /// Gets or sets the consent type associated with the current application. /// @@ -38,6 +49,11 @@ public class OpenIddictApplicationModel : ExtensibleObject /// public virtual string DisplayNames { get; set; } + /// + /// Gets or sets the JSON Web Key Set associated with the application. + /// + public virtual JsonWebKeySet JsonWebKeySet { get; set; } + /// /// Gets or sets the permissions associated with the /// current application, serialized as a JSON array. @@ -69,9 +85,9 @@ public class OpenIddictApplicationModel : ExtensibleObject public virtual string Requirements { get; set; } /// - /// Gets or sets the application type associated with the current application. + /// Gets the settings associated with the application. /// - public virtual string Type { get; set; } + public virtual string Settings { get; set; } /// /// URI to further information about client. diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/AbpOpenIddictAuthorizationCache.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/AbpOpenIddictAuthorizationCache.cs index 95c1a59526..5149d26c75 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/AbpOpenIddictAuthorizationCache.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/AbpOpenIddictAuthorizationCache.cs @@ -21,7 +21,7 @@ public class AbpOpenIddictAuthorizationCache : AbpOpenIddictCacheBase FindAsync(string subject, string client, [EnumeratorCancellation] CancellationToken cancellationToken) + public virtual async IAsyncEnumerable FindAsync(string subject, string client, [EnumeratorCancellation] CancellationToken cancellationToken) { Check.NotNullOrEmpty(subject, nameof(subject)); Check.NotNullOrEmpty(client, nameof(client)); @@ -52,7 +52,7 @@ public class AbpOpenIddictAuthorizationCache : AbpOpenIddictCacheBase FindAsync(string subject, string client, string status, [EnumeratorCancellation] CancellationToken cancellationToken) + public virtual async IAsyncEnumerable FindAsync(string subject, string client, string status, [EnumeratorCancellation] CancellationToken cancellationToken) { Check.NotNullOrEmpty(subject, nameof(subject)); Check.NotNullOrEmpty(client, nameof(client)); @@ -75,7 +75,7 @@ public class AbpOpenIddictAuthorizationCache : AbpOpenIddictCacheBase FindAsync(string subject, string client, string status, string type, [EnumeratorCancellation] CancellationToken cancellationToken) + public virtual async IAsyncEnumerable FindAsync(string subject, string client, string status, string type, [EnumeratorCancellation] CancellationToken cancellationToken) { Check.NotNullOrEmpty(subject, nameof(subject)); Check.NotNullOrEmpty(client, nameof(client)); @@ -99,7 +99,7 @@ public class AbpOpenIddictAuthorizationCache : AbpOpenIddictCacheBase FindAsync(string subject, string client, string status, string type, ImmutableArray scopes, [EnumeratorCancellation] CancellationToken cancellationToken) + public virtual async IAsyncEnumerable FindAsync(string subject, string client, string status, string type, ImmutableArray scopes, [EnumeratorCancellation] CancellationToken cancellationToken) { Check.NotNullOrEmpty(subject, nameof(subject)); Check.NotNullOrEmpty(client, nameof(client)); @@ -114,7 +114,7 @@ public class AbpOpenIddictAuthorizationCache : AbpOpenIddictCacheBase FindByApplicationIdAsync(string applicationId, [EnumeratorCancellation] CancellationToken cancellationToken) + public virtual async IAsyncEnumerable FindByApplicationIdAsync(string applicationId, [EnumeratorCancellation] CancellationToken cancellationToken) { Check.NotNullOrEmpty(applicationId, nameof(applicationId)); @@ -135,7 +135,7 @@ public class AbpOpenIddictAuthorizationCache : AbpOpenIddictCacheBase FindByIdAsync(string id, CancellationToken cancellationToken) + public virtual async ValueTask FindByIdAsync(string id, CancellationToken cancellationToken) { Check.NotNullOrEmpty(id, nameof(id)); @@ -143,7 +143,7 @@ public class AbpOpenIddictAuthorizationCache : AbpOpenIddictCacheBase await Store.FindByIdAsync(id, cancellationToken), token: cancellationToken); } - public async IAsyncEnumerable FindBySubjectAsync(string subject, [EnumeratorCancellation] CancellationToken cancellationToken) + public virtual async IAsyncEnumerable FindBySubjectAsync(string subject, [EnumeratorCancellation] CancellationToken cancellationToken) { Check.NotNullOrEmpty(subject, nameof(subject)); diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/AbpOpenIddictAuthorizationStore.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/AbpOpenIddictAuthorizationStore.cs index 9b96011a52..1a29f9cb4e 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/AbpOpenIddictAuthorizationStore.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/AbpOpenIddictAuthorizationStore.cs @@ -287,13 +287,14 @@ public class AbpOpenIddictAuthorizationStore : AbpOpenIddictStoreBase PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken) { using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: IsolationLevel.RepeatableRead)) { var date = threshold.UtcDateTime; - await Repository.PruneAsync(date, cancellationToken: cancellationToken); + var count = await Repository.PruneAsync(date, cancellationToken: cancellationToken); await uow.CompleteAsync(cancellationToken); + return count; } } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/IOpenIddictAuthorizationRepository.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/IOpenIddictAuthorizationRepository.cs index 0cca87ebb9..98c98b3e58 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/IOpenIddictAuthorizationRepository.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Authorizations/IOpenIddictAuthorizationRepository.cs @@ -22,5 +22,5 @@ public interface IOpenIddictAuthorizationRepository : IBasicRepository> ListAsync(int? count, int? offset, CancellationToken cancellationToken = default); - Task PruneAsync(DateTime date, CancellationToken cancellationToken = default); + Task PruneAsync(DateTime date, CancellationToken cancellationToken = default); } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Tokens/AbpOpenIddictTokenStore.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Tokens/AbpOpenIddictTokenStore.cs index 31f4007879..b861da8407 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Tokens/AbpOpenIddictTokenStore.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Tokens/AbpOpenIddictTokenStore.cs @@ -302,13 +302,19 @@ public class AbpOpenIddictTokenStore : AbpOpenIddictStoreBase RevokeByAuthorizationIdAsync(string identifier, CancellationToken cancellationToken) + { + return await Repository.RevokeByAuthorizationIdAsync(ConvertIdentifierFromString(identifier), cancellationToken); + } + + public virtual async ValueTask PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken) { using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: IsolationLevel.RepeatableRead)) { var date = threshold.UtcDateTime; - await Repository.PruneAsync(date, cancellationToken: cancellationToken); + var count = await Repository.PruneAsync(date, cancellationToken: cancellationToken); await uow.CompleteAsync(cancellationToken); + return count; } } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Tokens/IOpenIddictTokenRepository.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Tokens/IOpenIddictTokenRepository.cs index a747106642..1a1877746a 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Tokens/IOpenIddictTokenRepository.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Tokens/IOpenIddictTokenRepository.cs @@ -32,5 +32,7 @@ public interface IOpenIddictTokenRepository : IBasicRepository> ListAsync(int? count, int? offset, CancellationToken cancellationToken = default); - Task PruneAsync(DateTime date, CancellationToken cancellationToken = default); + Task PruneAsync(DateTime date, CancellationToken cancellationToken = default); + + ValueTask RevokeByAuthorizationIdAsync(Guid id, CancellationToken cancellationToken); } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Authorizations/EfCoreOpenIddictAuthorizationRepository.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Authorizations/EfCoreOpenIddictAuthorizationRepository.cs index 3738884b5c..62cf3abdd4 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Authorizations/EfCoreOpenIddictAuthorizationRepository.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Authorizations/EfCoreOpenIddictAuthorizationRepository.cs @@ -80,7 +80,7 @@ public class EfCoreOpenIddictAuthorizationRepository : EfCoreRepository PruneAsync(DateTime date, CancellationToken cancellationToken = default) { var authorizations = await (from authorization in (await GetQueryableAsync()) join token in (await GetDbContextAsync()).Set() @@ -91,11 +91,11 @@ public class EfCoreOpenIddictAuthorizationRepository : EfCoreRepository() + var count = await (from token in (await GetDbContextAsync()).Set() where token.AuthorizationId != null && authorizations.Contains(token.AuthorizationId.Value) select token) .ExecuteDeleteAsync(GetCancellationToken(cancellationToken)); - await (await GetDbSetAsync()).Where(x => authorizations.Contains(x.Id)).ExecuteDeleteAsync(cancellationToken); + return count + await (await GetDbSetAsync()).Where(x => authorizations.Contains(x.Id)).ExecuteDeleteAsync(cancellationToken); } } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/EntityFrameworkCore/OpenIddictDbContextModelCreatingExtensions.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/EntityFrameworkCore/OpenIddictDbContextModelCreatingExtensions.cs index bcf179297a..d10ecc86ae 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/EntityFrameworkCore/OpenIddictDbContextModelCreatingExtensions.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/EntityFrameworkCore/OpenIddictDbContextModelCreatingExtensions.cs @@ -28,14 +28,17 @@ public static class OpenIddictDbContextModelCreatingExtensions b.HasIndex(x => x.ClientId); //.IsUnique(); + b.Property(x => x.ApplicationType) + .HasMaxLength(OpenIddictApplicationConsts.ApplicationTypeMaxLength); + b.Property(x => x.ClientId) .HasMaxLength(OpenIddictApplicationConsts.ClientIdMaxLength); b.Property(x => x.ConsentType) .HasMaxLength(OpenIddictApplicationConsts.ConsentTypeMaxLength); - b.Property(x => x.Type) - .HasMaxLength(OpenIddictApplicationConsts.TypeMaxLength); + b.Property(x => x.ClientType) + .HasMaxLength(OpenIddictApplicationConsts.ClientTypeMaxLength); b.ApplyObjectExtensionMappings(); }); diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Tokens/EfCoreOpenIddictTokenRepository.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Tokens/EfCoreOpenIddictTokenRepository.cs index c1ed4a84ff..d861f8b54e 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Tokens/EfCoreOpenIddictTokenRepository.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Tokens/EfCoreOpenIddictTokenRepository.cs @@ -96,9 +96,9 @@ public class EfCoreOpenIddictTokenRepository : EfCoreRepository PruneAsync(DateTime date, CancellationToken cancellationToken = default) { - await (from token in await GetQueryableAsync() + return await (from token in await GetQueryableAsync() join authorization in (await GetDbContextAsync()).Set() on token.AuthorizationId equals authorization.Id into tokenAuthorizations from tokenAuthorization in tokenAuthorizations.DefaultIfEmpty() @@ -109,4 +109,12 @@ public class EfCoreOpenIddictTokenRepository : EfCoreRepository RevokeByAuthorizationIdAsync(Guid id, CancellationToken cancellationToken) + { + return await (from token in await GetQueryableAsync() where token.AuthorizationId == id select token) + .ExecuteUpdateAsync( + entity => entity.SetProperty(token => token.Status, OpenIddictConstants.Statuses.Revoked), + GetCancellationToken(cancellationToken)); + } } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.MongoDB/Volo/Abp/OpenIddict/Authorizations/MongoOpenIddictAuthorizationRepository.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.MongoDB/Volo/Abp/OpenIddict/Authorizations/MongoOpenIddictAuthorizationRepository.cs index 7225425581..3e30912a8d 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.MongoDB/Volo/Abp/OpenIddict/Authorizations/MongoOpenIddictAuthorizationRepository.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.MongoDB/Volo/Abp/OpenIddict/Authorizations/MongoOpenIddictAuthorizationRepository.cs @@ -71,7 +71,7 @@ public class MongoOpenIddictAuthorizationRepository : MongoDbRepository>().ToListAsync(GetCancellationToken(cancellationToken)); } - public virtual async Task PruneAsync(DateTime date, CancellationToken cancellationToken = default) + public virtual async Task PruneAsync(DateTime date, CancellationToken cancellationToken = default) { var tokenIds = await (await GetMongoQueryableAsync(cancellationToken)) .Where(x => x.AuthorizationId != null) @@ -107,5 +107,6 @@ public class MongoOpenIddictAuthorizationRepository : MongoDbRepository PruneAsync(DateTime date, CancellationToken cancellationToken = default) { var authorizationIds = await (await GetMongoQueryableAsync(cancellationToken)) .Where(x => x.Status != OpenIddictConstants.Statuses.Valid) @@ -125,5 +125,16 @@ public class MongoOpenIddictTokenRepository : MongoDbRepository RevokeByAuthorizationIdAsync(Guid id, CancellationToken cancellationToken) + { + return (await (await GetCollectionAsync(GetCancellationToken(cancellationToken))).UpdateManyAsync( + filter: token => token.AuthorizationId == id, + update: Builders.Update.Set(token => token.Status, OpenIddictConstants.Statuses.Revoked), + options: null, + cancellationToken: GetCancellationToken(cancellationToken))).MatchedCount; } } diff --git a/modules/openiddict/test/Volo.Abp.OpenIddict.Domain.Tests/Volo/Abp/OpenIddict/Applications/AbpOpenIddictApplicationStore_Tests.cs b/modules/openiddict/test/Volo.Abp.OpenIddict.Domain.Tests/Volo/Abp/OpenIddict/Applications/AbpOpenIddictApplicationStore_Tests.cs index 81dafe33c3..c4aac7b144 100644 --- a/modules/openiddict/test/Volo.Abp.OpenIddict.Domain.Tests/Volo/Abp/OpenIddict/Applications/AbpOpenIddictApplicationStore_Tests.cs +++ b/modules/openiddict/test/Volo.Abp.OpenIddict.Domain.Tests/Volo/Abp/OpenIddict/Applications/AbpOpenIddictApplicationStore_Tests.cs @@ -6,6 +6,7 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; +using Microsoft.IdentityModel.Tokens; using OpenIddict.Abstractions; using Shouldly; using Xunit; @@ -30,12 +31,12 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase var application = await _applicationStore.FindByIdAsync(nonExistingId, CancellationToken.None); application.ShouldBeNull(); } - + [Fact] public async Task FindByIdAsync_Should_Return_Application_If_Found() { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); - + application.ShouldNotBeNull(); application.ClientId.ShouldBe(_testData.App1ClientId); application.ConsentType.ShouldBe(OpenIddictConstants.ConsentTypes.Explicit); @@ -73,19 +74,24 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var clientId = Guid.NewGuid().ToString(); await _applicationStore.CreateAsync(new OpenIddictApplicationModel { + ApplicationType = OpenIddictConstants.ApplicationTypes.Web, ClientId = clientId, ConsentType = OpenIddictConstants.ConsentTypes.Explicit, DisplayName = "Test Application", - Type = OpenIddictConstants.ClientTypes.Public, + ClientType = OpenIddictConstants.ClientTypes.Public, + JsonWebKeySet = JsonWebKeySet.Create("{\"keys\":[{\"kid\":\"B3CFECA9F030CB8DA7EC0C2C27462E0F1EDB5920\",\"use\":\"sig\",\"kty\":\"RSA\",\"alg\":\"RS256\",\"e\":\"AQAB\",\"n\":\"yvTJVUUPNKui4mc12Z9sasNC1xQ_feZLhYDUqrMYDrbbOdHNdppCRQa8hwZBAgru7mJn-qD1aBDHZQFp0h_tWME5B5c07Y8b80w0vBWgfhgw0Kvzet6aDtVRVFZ0pJ92sIto0gcEeU2cst21s21ICGI3bT80-BIrWe_OGbWt0LwkTYLMGFaSiIov65OqnBm9LiZFgpANk8gajmPW49Jp9w4N6dXKJmpLD4Ke0TqHV1wx3DepYs9cdXlyEAh_Zb6iX7-GaIqkpiG32Ej1ezc-Qfjy16nt1mxrDkgZNROXeo9dSKT-zCuUNaAoDj93vFFnKzdGB4wiUbeRb-fvebAKDw\",\"x5t\":\"s8_sqfAwy42n7AwsJ0YuDx7bWSA\",\"x5c\":[\"MIIDzTCCArWgAwIBAgIJAJk4OSYyxcY2MA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBAYTAlRSMREwDwYDVQQHDAhJc3RhbmJ1bDEZMBcGA1UECgwQVm9sb3NvZnQgTFRELlNUSTEXMBUGA1UEAwwOYWNjb3VudC5hYnAuaW8xJzAlBgkqhkiG9w0BCQEWGGdhbGlwLmVyZGVtQHZvbG9zb2Z0LmNvbTAeFw0yMDAxMjExNjQ1MTBaFw0zMDAxMTgxNjQ1MTBaMH0xCzAJBgNVBAYTAlRSMREwDwYDVQQHDAhJc3RhbmJ1bDEZMBcGA1UECgwQVm9sb3NvZnQgTFRELlNUSTEXMBUGA1UEAwwOYWNjb3VudC5hYnAuaW8xJzAlBgkqhkiG9w0BCQEWGGdhbGlwLmVyZGVtQHZvbG9zb2Z0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMr0yVVFDzSrouJnNdmfbGrDQtcUP33mS4WA1KqzGA622znRzXaaQkUGvIcGQQIK7u5iZ/qg9WgQx2UBadIf7VjBOQeXNO2PG/NMNLwVoH4YMNCr83remg7VUVRWdKSfdrCLaNIHBHlNnLLdtbNtSAhiN20/NPgSK1nvzhm1rdC8JE2CzBhWkoiKL+uTqpwZvS4mRYKQDZPIGo5j1uPSafcODenVyiZqSw+CntE6h1dcMdw3qWLPXHV5chAIf2W+ol+/hmiKpKYht9hI9Xs3PkH48tep7dZsaw5IGTUTl3qPXUik/swrlDWgKA4/d7xRZys3RgeMIlG3kW/n73mwCg8CAwEAAaNQME4wHQYDVR0OBBYEFCnN7HANDCj/ncgFu4AI+U6wXn2AMB8GA1UdIwQYMBaAFCnN7HANDCj/ncgFu4AI+U6wXn2AMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAEvVPtZnXzebhgVIyD+TBE7cgI567ck5W9kfeZhJLPlWQzrOQCgXbR7rqNLRs4K73k6Yo6/9E5jAOtjlqqotiqj89tqOTZzG6kDIVoMiYJjgEVLeF1bVBnCA7xDbdpVfrL2IOnNGy9Ys+FsG6EV/oBbTw8Fqk+5c7M0RvverCaEfPHWSTg6M+B5pHBk50p67MB6DeaD0u6RUnCkqYxBBPrnVHvvGEoimoEAdT5g3/8CAtAG9m4b9IoBpUHi626b+/SS+2h1xr4oq54gxG8jlDkLoRWT2cKiFM/bCufZkd1LyOmke8udpHBZ3Jt0nH64oZdSUT6huDzYBdtXfSw3XTwo=\"]}]}"), PostLogoutRedirectUris = "https://abp.io", RedirectUris = "https://abp.io" }, CancellationToken.None); - + var application = await _applicationStore.FindByClientIdAsync(clientId, CancellationToken.None); application.ShouldNotBeNull(); + application.ApplicationType.ShouldBe(OpenIddictConstants.ApplicationTypes.Web); application.ClientId.ShouldBe(clientId); application.DisplayName.ShouldBe("Test Application"); - application.Type.ShouldBe(OpenIddictConstants.ClientTypes.Public); + application.ClientType.ShouldBe(OpenIddictConstants.ClientTypes.Public); + application.JsonWebKeySet.ShouldNotBeNull(); + application.JsonWebKeySet.Keys.First().Alg.ShouldBe(SecurityAlgorithms.RsaSha256); application.PostLogoutRedirectUris.ShouldBe("https://abp.io"); application.RedirectUris.ShouldBe("https://abp.io"); } @@ -95,9 +101,9 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); application.ShouldNotBeNull(); - + await _applicationStore.DeleteAsync(application, CancellationToken.None); - + application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); application.ShouldBeNull(); } @@ -115,14 +121,14 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase var applications = await _applicationStore.FindByPostLogoutRedirectUriAsync("https://abp.io", CancellationToken.None).ToListAsync(); applications.Count.ShouldBe(2); } - + [Fact] public async Task FindByRedirectUriAsync_Should_Return_Empty_If_Not_Found() { var applications = await _applicationStore.FindByRedirectUriAsync("non-existing-uri", CancellationToken.None).ToListAsync(); applications.Count.ShouldBe(0); } - + [Fact] public async Task FindByRedirectUriAsync_Should_Return_Applications_If_Found() { @@ -135,7 +141,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var clientId = await _applicationStore.GetClientIdAsync(application, CancellationToken.None); - + clientId.ShouldBe(_testData.App1ClientId); } @@ -144,7 +150,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var secret = await _applicationStore.GetClientIdAsync(application, CancellationToken.None); - + secret.ShouldBe("Client1"); } @@ -153,7 +159,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var clientType = await _applicationStore.GetClientTypeAsync(application, CancellationToken.None); - + clientType.ShouldBe(OpenIddictConstants.ClientTypes.Public); } @@ -162,7 +168,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var consentType = await _applicationStore.GetConsentTypeAsync(application, CancellationToken.None); - + consentType.ShouldBe(OpenIddictConstants.ConsentTypes.Explicit); } @@ -171,7 +177,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var displayName = await _applicationStore.GetDisplayNameAsync(application, CancellationToken.None); - + displayName.ShouldBe("Test Application"); } @@ -180,7 +186,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var id = await _applicationStore.GetIdAsync(application, CancellationToken.None); - + id.ShouldBe(_testData.App1Id.ToString()); } @@ -189,7 +195,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var permissions = await _applicationStore.GetPermissionsAsync(application, CancellationToken.None); - + permissions.Length.ShouldBeGreaterThan(0); } @@ -198,7 +204,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var postLogoutRedirectUris = await _applicationStore.GetPostLogoutRedirectUrisAsync(application, CancellationToken.None); - + postLogoutRedirectUris.Length.ShouldBe(1); postLogoutRedirectUris[0].ShouldBe("https://abp.io"); } @@ -208,7 +214,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var redirectUris = await _applicationStore.GetRedirectUrisAsync(application, CancellationToken.None); - + redirectUris.Length.ShouldBe(1); redirectUris[0].ShouldBe("https://abp.io"); } @@ -218,7 +224,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var properties = await _applicationStore.GetPropertiesAsync(application, CancellationToken.None); - + properties.Count.ShouldBe(0); } @@ -227,14 +233,14 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); var requirements = await _applicationStore.GetRequirementsAsync(application, CancellationToken.None); - + requirements.Length.ShouldBe(0); } [Fact] public async Task InstantiateAsync() { - var application = await _applicationStore.InstantiateAsync(CancellationToken.None); + var application = await _applicationStore.InstantiateAsync(CancellationToken.None); application.ShouldNotBeNull(); } @@ -268,7 +274,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase var clientSecret = Guid.NewGuid().ToString(); var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetClientSecretAsync(application, clientSecret, CancellationToken.None); - + application.ClientSecret.ShouldBe(clientSecret); } @@ -277,8 +283,8 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetClientTypeAsync(application, OpenIddictConstants.ClientTypes.Confidential, CancellationToken.None); - - application.Type.ShouldBe(OpenIddictConstants.ClientTypes.Confidential); + + application.ClientType.ShouldBe(OpenIddictConstants.ClientTypes.Confidential); } [Fact] @@ -286,17 +292,17 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetConsentTypeAsync(application, OpenIddictConstants.ConsentTypes.Systematic, CancellationToken.None); - + application.ConsentType.ShouldBe(OpenIddictConstants.ConsentTypes.Systematic); } - + [Fact] public async Task SetDisplayNameAsync() { var displayName = Guid.NewGuid().ToString(); var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetDisplayNameAsync(application, displayName, CancellationToken.None); - + application.DisplayName.ShouldBe(displayName); } @@ -306,7 +312,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase var displayNames = ImmutableDictionary.Create(); displayNames = displayNames.Add(CultureInfo.GetCultureInfo("en"), "Test Application"); displayNames = displayNames.Add(CultureInfo.GetCultureInfo("zh-Hans"), "测试应用程序"); - + var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetDisplayNamesAsync(application, displayNames, CancellationToken.None); @@ -319,7 +325,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetPermissionsAsync(application, ImmutableArray.Create(OpenIddictConstants.Permissions.Endpoints.Authorization), CancellationToken.None); - + application.Permissions.ShouldBe("[\""+OpenIddictConstants.Permissions.Endpoints.Authorization+"\"]"); } @@ -328,7 +334,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetPostLogoutRedirectUrisAsync(application, ImmutableArray.Create("https://abp.io"), CancellationToken.None); - + application.PostLogoutRedirectUris.ShouldBe("[\"https://abp.io\"]"); } @@ -337,7 +343,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetPropertiesAsync(application, ImmutableDictionary.Create(), CancellationToken.None); - + application.Properties.ShouldBeNull(); } @@ -346,7 +352,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetRedirectUrisAsync(application, ImmutableArray.Create("https://abp.io"), CancellationToken.None); - + application.RedirectUris.ShouldBe("[\"https://abp.io\"]"); } @@ -355,7 +361,7 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); await _applicationStore.SetRequirementsAsync(application, ImmutableArray.Create(OpenIddictConstants.Requirements.Features.ProofKeyForCodeExchange), CancellationToken.None); - + application.Requirements.ShouldBe("[\""+OpenIddictConstants.Requirements.Features.ProofKeyForCodeExchange+"\"]"); } @@ -364,19 +370,19 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase { var application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); application.ClientId = "new_client_id"; - application.Type = OpenIddictConstants.ClientTypes.Public; + application.ClientType = OpenIddictConstants.ClientTypes.Public; application.RedirectUris = "https://new_logout_uri"; application.PostLogoutRedirectUris = "https://new_post_logout_uri"; application.DisplayName = "new_display_name"; - + await _applicationStore.UpdateAsync(application, CancellationToken.None); application = await _applicationStore.FindByIdAsync(_testData.App1Id.ToString(), CancellationToken.None); application.ShouldNotBeNull(); application.ClientId.ShouldBe("new_client_id"); - application.Type.ShouldBe(OpenIddictConstants.ClientTypes.Public); + application.ClientType.ShouldBe(OpenIddictConstants.ClientTypes.Public); application.RedirectUris.ShouldBe("https://new_logout_uri"); application.PostLogoutRedirectUris.ShouldBe("https://new_post_logout_uri"); application.DisplayName.ShouldBe("new_display_name"); } -} \ No newline at end of file +} diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231115065150_Initial.Designer.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231207053812_Initial.Designer.cs similarity index 99% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231115065150_Initial.Designer.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231207053812_Initial.Designer.cs index 55e4ed5121..333df53077 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231115065150_Initial.Designer.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231207053812_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations { [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20231115065150_Initial")] + [Migration("20231207053812_Initial")] partial class Initial { /// @@ -1081,6 +1081,10 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1088,6 +1092,10 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1135,6 +1143,9 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1161,9 +1172,8 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231115065150_Initial.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231207053812_Initial.cs similarity index 99% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231115065150_Initial.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231207053812_Initial.cs index 10e01ba747..e993702885 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231115065150_Initial.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20231207053812_Initial.cs @@ -374,17 +374,20 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), + ApplicationType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), ClientSecret = table.Column(type: "nvarchar(max)", nullable: true), + ClientType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), DisplayName = table.Column(type: "nvarchar(max)", nullable: true), DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), + JsonWebKeySet = table.Column(type: "nvarchar(max)", nullable: true), Permissions = table.Column(type: "nvarchar(max)", nullable: true), PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Properties = table.Column(type: "nvarchar(max)", nullable: true), RedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Requirements = table.Column(type: "nvarchar(max)", nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Settings = table.Column(type: "nvarchar(max)", nullable: true), ClientUri = table.Column(type: "nvarchar(max)", nullable: true), LogoUri = table.Column(type: "nvarchar(max)", nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/MyProjectNameDbContextModelSnapshot.cs index 7e2a18a401..1def4a0ee9 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -1078,6 +1078,10 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1085,6 +1089,10 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1132,6 +1140,9 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1158,9 +1169,8 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server.Mongo/Data/OpenIddictDataSeedContributor.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server.Mongo/Data/OpenIddictDataSeedContributor.cs index 47eae54f36..117aeeb123 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server.Mongo/Data/OpenIddictDataSeedContributor.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server.Mongo/Data/OpenIddictDataSeedContributor.cs @@ -152,7 +152,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep var application = new AbpApplicationDescriptor { ClientId = name, - Type = type, + ClientType = type, ClientSecret = secret, ConsentType = consentType, DisplayName = displayName, diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Data/OpenIddictDataSeedContributor.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Data/OpenIddictDataSeedContributor.cs index 47eae54f36..117aeeb123 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Data/OpenIddictDataSeedContributor.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Data/OpenIddictDataSeedContributor.cs @@ -152,7 +152,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep var application = new AbpApplicationDescriptor { ClientId = name, - Type = type, + ClientType = type, ClientSecret = secret, ConsentType = consentType, DisplayName = displayName, diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231115065250_Initial.Designer.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231207053830_Initial.Designer.cs similarity index 99% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231115065250_Initial.Designer.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231207053830_Initial.Designer.cs index 7cd0e3cb68..ac18b045c6 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231115065250_Initial.Designer.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231207053830_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20231115065250_Initial")] + [Migration("20231207053830_Initial")] partial class Initial { /// @@ -1081,6 +1081,10 @@ namespace MyCompanyName.MyProjectName.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1088,6 +1092,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1135,6 +1143,9 @@ namespace MyCompanyName.MyProjectName.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1161,9 +1172,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231115065520_Initial.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231207053830_Initial.cs similarity index 99% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231115065520_Initial.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231207053830_Initial.cs index 193fa0b299..7a0019fbf6 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231115065520_Initial.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231207053830_Initial.cs @@ -374,17 +374,20 @@ namespace MyCompanyName.MyProjectName.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), + ApplicationType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), ClientSecret = table.Column(type: "nvarchar(max)", nullable: true), + ClientType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), DisplayName = table.Column(type: "nvarchar(max)", nullable: true), DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), + JsonWebKeySet = table.Column(type: "nvarchar(max)", nullable: true), Permissions = table.Column(type: "nvarchar(max)", nullable: true), PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Properties = table.Column(type: "nvarchar(max)", nullable: true), RedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Requirements = table.Column(type: "nvarchar(max)", nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Settings = table.Column(type: "nvarchar(max)", nullable: true), ClientUri = table.Column(type: "nvarchar(max)", nullable: true), LogoUri = table.Column(type: "nvarchar(max)", nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/MyProjectNameDbContextModelSnapshot.cs index 6462a2f8da..20542b282c 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -1078,6 +1078,10 @@ namespace MyCompanyName.MyProjectName.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1085,6 +1089,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1132,6 +1140,9 @@ namespace MyCompanyName.MyProjectName.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1158,9 +1169,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Data/OpenIddictDataSeedContributor.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Data/OpenIddictDataSeedContributor.cs index 51dca1344f..37ca7e6c12 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Data/OpenIddictDataSeedContributor.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Data/OpenIddictDataSeedContributor.cs @@ -152,7 +152,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep var application = new OpenIddictApplicationDescriptor { ClientId = name, - Type = type, + ClientType = type, ClientSecret = secret, ConsentType = consentType, DisplayName = displayName diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Data/OpenIddictDataSeedContributor.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Data/OpenIddictDataSeedContributor.cs index 51dca1344f..37ca7e6c12 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Data/OpenIddictDataSeedContributor.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Data/OpenIddictDataSeedContributor.cs @@ -152,7 +152,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep var application = new OpenIddictApplicationDescriptor { ClientId = name, - Type = type, + ClientType = type, ClientSecret = secret, ConsentType = consentType, DisplayName = displayName diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231115065335_Initial.Designer.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231207053820_Initial.Designer.cs similarity index 99% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231115065335_Initial.Designer.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231207053820_Initial.Designer.cs index bc2858d83c..333258a426 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231115065335_Initial.Designer.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231207053820_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Host.Migrations { [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20231115065335_Initial")] + [Migration("20231207053820_Initial")] partial class Initial { /// @@ -1081,6 +1081,10 @@ namespace MyCompanyName.MyProjectName.Host.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1088,6 +1092,10 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1135,6 +1143,9 @@ namespace MyCompanyName.MyProjectName.Host.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1161,9 +1172,8 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231115065335_Initial.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231207053820_Initial.cs similarity index 99% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231115065335_Initial.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231207053820_Initial.cs index 3b285fc029..08eca1feca 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231115065335_Initial.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20231207053820_Initial.cs @@ -374,17 +374,20 @@ namespace MyCompanyName.MyProjectName.Host.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), + ApplicationType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), ClientSecret = table.Column(type: "nvarchar(max)", nullable: true), + ClientType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), DisplayName = table.Column(type: "nvarchar(max)", nullable: true), DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), + JsonWebKeySet = table.Column(type: "nvarchar(max)", nullable: true), Permissions = table.Column(type: "nvarchar(max)", nullable: true), PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Properties = table.Column(type: "nvarchar(max)", nullable: true), RedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Requirements = table.Column(type: "nvarchar(max)", nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Settings = table.Column(type: "nvarchar(max)", nullable: true), ClientUri = table.Column(type: "nvarchar(max)", nullable: true), LogoUri = table.Column(type: "nvarchar(max)", nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/MyProjectNameDbContextModelSnapshot.cs index ffd0a7c154..6475d362fa 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -1078,6 +1078,10 @@ namespace MyCompanyName.MyProjectName.Host.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1085,6 +1089,10 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1132,6 +1140,9 @@ namespace MyCompanyName.MyProjectName.Host.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1158,9 +1169,8 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231115065427_Initial.Designer.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231207053825_Initial.Designer.cs similarity index 99% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231115065427_Initial.Designer.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231207053825_Initial.Designer.cs index 5980cd27ff..11234086f3 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231115065427_Initial.Designer.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231207053825_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Mvc.Migrations { [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20231115065427_Initial")] + [Migration("20231207053825_Initial")] partial class Initial { /// @@ -1081,6 +1081,10 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1088,6 +1092,10 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1135,6 +1143,9 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1161,9 +1172,8 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231115065427_Initial.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231207053825_Initial.cs similarity index 99% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231115065427_Initial.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231207053825_Initial.cs index 2263582b8a..ef1ec2fdd6 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231115065427_Initial.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20231207053825_Initial.cs @@ -374,17 +374,20 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), + ApplicationType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), ClientSecret = table.Column(type: "nvarchar(max)", nullable: true), + ClientType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), DisplayName = table.Column(type: "nvarchar(max)", nullable: true), DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), + JsonWebKeySet = table.Column(type: "nvarchar(max)", nullable: true), Permissions = table.Column(type: "nvarchar(max)", nullable: true), PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Properties = table.Column(type: "nvarchar(max)", nullable: true), RedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Requirements = table.Column(type: "nvarchar(max)", nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Settings = table.Column(type: "nvarchar(max)", nullable: true), ClientUri = table.Column(type: "nvarchar(max)", nullable: true), LogoUri = table.Column(type: "nvarchar(max)", nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/MyProjectNameDbContextModelSnapshot.cs index d2df918898..1e8916ad04 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -1078,6 +1078,10 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1085,6 +1089,10 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1132,6 +1140,9 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1158,9 +1169,8 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs index a1af7f6b6a..8e0f486bfb 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -230,7 +230,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep var application = new AbpApplicationDescriptor { ClientId = name, - Type = type, + ClientType = type, ClientSecret = secret, ConsentType = consentType, DisplayName = displayName, diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231115065038_Initial.Designer.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231207053523_Initial.Designer.cs similarity index 99% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231115065038_Initial.Designer.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231207053523_Initial.Designer.cs index 5310a4a849..c52403afd3 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231115065038_Initial.Designer.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231207053523_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20231115065038_Initial")] + [Migration("20231207053523_Initial")] partial class Initial { /// @@ -1134,6 +1134,10 @@ namespace MyCompanyName.MyProjectName.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1141,6 +1145,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1188,6 +1196,9 @@ namespace MyCompanyName.MyProjectName.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1214,9 +1225,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231115065038_Initial.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231207053523_Initial.cs similarity index 99% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231115065038_Initial.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231207053523_Initial.cs index bef0c6b97d..a5027f58de 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231115065038_Initial.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20231207053523_Initial.cs @@ -395,17 +395,20 @@ namespace MyCompanyName.MyProjectName.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), + ApplicationType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), ClientSecret = table.Column(type: "nvarchar(max)", nullable: true), + ClientType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), DisplayName = table.Column(type: "nvarchar(max)", nullable: true), DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), + JsonWebKeySet = table.Column(type: "nvarchar(max)", nullable: true), Permissions = table.Column(type: "nvarchar(max)", nullable: true), PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Properties = table.Column(type: "nvarchar(max)", nullable: true), RedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Requirements = table.Column(type: "nvarchar(max)", nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Settings = table.Column(type: "nvarchar(max)", nullable: true), ClientUri = table.Column(type: "nvarchar(max)", nullable: true), LogoUri = table.Column(type: "nvarchar(max)", nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs index 5c670f0bf3..8a0febed15 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -1131,6 +1131,10 @@ namespace MyCompanyName.MyProjectName.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1138,6 +1142,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1185,6 +1193,9 @@ namespace MyCompanyName.MyProjectName.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1211,9 +1222,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231115065520_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231207053828_Initial.Designer.cs similarity index 99% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231115065520_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231207053828_Initial.Designer.cs index 27271c1515..389a2a8cc3 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231115065520_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231207053828_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(AuthServerDbContext))] - [Migration("20231115065520_Initial")] + [Migration("20231207053828_Initial")] partial class Initial { /// @@ -1081,6 +1081,10 @@ namespace MyCompanyName.MyProjectName.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1088,6 +1092,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1135,6 +1143,9 @@ namespace MyCompanyName.MyProjectName.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1161,9 +1172,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231115065250_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231207053828_Initial.cs similarity index 99% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231115065250_Initial.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231207053828_Initial.cs index 193fa0b299..7a0019fbf6 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/Migrations/20231115065250_Initial.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20231207053828_Initial.cs @@ -374,17 +374,20 @@ namespace MyCompanyName.MyProjectName.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), + ApplicationType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), ClientSecret = table.Column(type: "nvarchar(max)", nullable: true), + ClientType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), DisplayName = table.Column(type: "nvarchar(max)", nullable: true), DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), + JsonWebKeySet = table.Column(type: "nvarchar(max)", nullable: true), Permissions = table.Column(type: "nvarchar(max)", nullable: true), PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Properties = table.Column(type: "nvarchar(max)", nullable: true), RedirectUris = table.Column(type: "nvarchar(max)", nullable: true), Requirements = table.Column(type: "nvarchar(max)", nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Settings = table.Column(type: "nvarchar(max)", nullable: true), ClientUri = table.Column(type: "nvarchar(max)", nullable: true), LogoUri = table.Column(type: "nvarchar(max)", nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/AuthServerDbContextModelSnapshot.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/AuthServerDbContextModelSnapshot.cs index 49d4b8b408..c63e7d13e1 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/AuthServerDbContextModelSnapshot.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/AuthServerDbContextModelSnapshot.cs @@ -1078,6 +1078,10 @@ namespace MyCompanyName.MyProjectName.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -1085,6 +1089,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("ClientSecret") .HasColumnType("nvarchar(max)"); + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + b.Property("ClientUri") .HasColumnType("nvarchar(max)"); @@ -1132,6 +1140,9 @@ namespace MyCompanyName.MyProjectName.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -1158,9 +1169,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Requirements") .HasColumnType("nvarchar(max)"); - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("Settings") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/OpenIddict/OpenIddictDataSeedContributor.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/OpenIddict/OpenIddictDataSeedContributor.cs index 6d18e53622..29b1751bee 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/OpenIddict/OpenIddictDataSeedContributor.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/OpenIddict/OpenIddictDataSeedContributor.cs @@ -204,7 +204,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep var application = new OpenIddictApplicationDescriptor { ClientId = name, - Type = type, + ClientType = type, ClientSecret = secret, ConsentType = consentType, DisplayName = displayName