From 6b426c12c69974779e71388437a3265a53376e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 28 Feb 2018 14:23:11 +0300 Subject: [PATCH] Create initial AuthServer demo project. --- .gitignore | 1 + Volo.Abp.sln | 28 +- .../Db/MigrationDbContext.cs | 21 + .../Db/MigrationDbContextFactory.cs | 17 + .../MicroserviceDemo.AuthServer.csproj | 31 ++ .../MicroservicesAuthServerModule.cs | 74 +++ ...52_Added_IdentityServer_Module.Designer.cs | 526 ++++++++++++++++++ ...80228110952_Added_IdentityServer_Module.cs | 448 +++++++++++++++ .../MigrationDbContextModelSnapshot.cs | 525 +++++++++++++++++ .../MicroserviceDemo.AuthServer/Program.cs | 21 + .../Properties/launchSettings.json | 27 + .../MicroserviceDemo.AuthServer/Startup.cs | 36 ++ .../appsettings.json | 5 + .../MicroserviceDemo.AuthServer/tempkey.rsa | 1 + .../MicroserviceDemo.TenancyService.csproj | 7 + .../MicroserviceDemo.Web.csproj | 8 +- .../MicroservicesDemoWebModule.cs | 1 - ...o.Abp.Account.Application.Contracts.csproj | 21 - .../AbpAccountApplicationContractsModule.cs | 15 - .../Volo/Abp/Account/ILoginAppService.cs | 8 - .../Volo.Abp.Account.Application.csproj | 20 - .../AbpAccountApplicationContractsModule.cs | 14 - .../Volo/Abp/Account/LoginAppService.cs | 6 - .../AbpAccountWebIdentityServerModule.cs | 20 + .../Properties/launchSettings.json | 27 + ...Volo.Abp.Account.Web.IdentityServer.csproj | 31 ++ .../AbpAccountWebModule.cs | 1 - .../Volo.Abp.Account.Web.csproj | 5 - .../AbpAspNetCoreMvcUiBootstrapModule.cs | 2 + .../Pages/_ViewImports.cshtml | 0 .../Pages/_ViewStart.cshtml | 0 .../Views/_ViewImports.cshtml | 0 .../Views/_ViewStart.cshtml | 0 ...olo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj | 2 + 34 files changed, 1843 insertions(+), 106 deletions(-) create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContext.cs create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContextFactory.cs create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroserviceDemo.AuthServer.csproj create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.Designer.cs create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.cs create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/MigrationDbContextModelSnapshot.cs create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/Program.cs create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/Startup.cs create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json create mode 100644 src/MicroserviceDemo/MicroserviceDemo.AuthServer/tempkey.rsa delete mode 100644 src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj delete mode 100644 src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs delete mode 100644 src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/ILoginAppService.cs delete mode 100644 src/Volo.Abp.Account.Application/Volo.Abp.Account.Application.csproj delete mode 100644 src/Volo.Abp.Account.Application/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs delete mode 100644 src/Volo.Abp.Account.Application/Volo/Abp/Account/LoginAppService.cs create mode 100644 src/Volo.Abp.Account.Web.IdentityServer/AbpAccountWebIdentityServerModule.cs create mode 100644 src/Volo.Abp.Account.Web.IdentityServer/Properties/launchSettings.json create mode 100644 src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj rename src/{MicroserviceDemo/MicroserviceDemo.Web => Volo.Abp.AspNetCore.Mvc.UI.Bootstrap}/Pages/_ViewImports.cshtml (100%) rename src/{MicroserviceDemo/MicroserviceDemo.Web => Volo.Abp.AspNetCore.Mvc.UI.Bootstrap}/Pages/_ViewStart.cshtml (100%) rename src/{MicroserviceDemo/MicroserviceDemo.Web => Volo.Abp.AspNetCore.Mvc.UI.Bootstrap}/Views/_ViewImports.cshtml (100%) rename src/{MicroserviceDemo/MicroserviceDemo.Web => Volo.Abp.AspNetCore.Mvc.UI.Bootstrap}/Views/_ViewStart.cshtml (100%) diff --git a/.gitignore b/.gitignore index f5616caf6a..cf6f59024d 100644 --- a/.gitignore +++ b/.gitignore @@ -257,3 +257,4 @@ src/AbpDesk/AbpDesk.Web.Mvc/Logs /src/Volo.Abp.Identity.HttpApi.Host/Logs src/MicroserviceDemo/MicroserviceDemo.Web/Logs/*.txt src/MicroserviceDemo/MicroserviceDemo.TenantService/Logs/*.txt +src/MicroserviceDemo/MicroserviceDemo.AuthServer/Logs/*.txt \ No newline at end of file diff --git a/Volo.Abp.sln b/Volo.Abp.sln index e27fb4bcc7..ee8cece3d9 100644 --- a/Volo.Abp.sln +++ b/Volo.Abp.sln @@ -144,10 +144,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.Account", "Abp.Account" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Account.Web", "src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj", "{F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Account.Application", "src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj", "{723709F9-09FB-4715-A5D2-DAC8833D8CF7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Account.Application.Contracts", "src\Volo.Abp.Account.Application.Contracts\Volo.Abp.Account.Application.Contracts.csproj", "{3E62ED84-8792-4DA6-9B0A-AADEA183C2B3}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.VirtualFileSystem", "src\Volo.Abp.VirtualFileSystem\Volo.Abp.VirtualFileSystem.csproj", "{6E6A7554-3488-45AB-BC0E-9BDE1F19789D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.VirtualFileSystem.Tests", "test\Volo.Abp.VirtualFileSystem.Tests\Volo.Abp.VirtualFileSystem.Tests.csproj", "{F79B6D80-C79B-4C13-9221-CA2345983743}" @@ -300,6 +296,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroserviceDemo.TenancySer EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.HttpApi.Client", "src\Volo.Abp.MultiTenancy.HttpApi.Client\Volo.Abp.MultiTenancy.HttpApi.Client.csproj", "{76D24E2C-8DB0-48B7-9FC4-02231B8B9F39}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicroserviceDemo.AuthServer", "src\MicroserviceDemo\MicroserviceDemo.AuthServer\MicroserviceDemo.AuthServer.csproj", "{A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Account.Web.IdentityServer", "src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj", "{E4AB8A4F-BB59-4BDB-B915-877CE97D8113}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -522,14 +522,6 @@ Global {F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B}.Debug|Any CPU.Build.0 = Debug|Any CPU {F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B}.Release|Any CPU.Build.0 = Release|Any CPU - {723709F9-09FB-4715-A5D2-DAC8833D8CF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {723709F9-09FB-4715-A5D2-DAC8833D8CF7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {723709F9-09FB-4715-A5D2-DAC8833D8CF7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {723709F9-09FB-4715-A5D2-DAC8833D8CF7}.Release|Any CPU.Build.0 = Release|Any CPU - {3E62ED84-8792-4DA6-9B0A-AADEA183C2B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E62ED84-8792-4DA6-9B0A-AADEA183C2B3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E62ED84-8792-4DA6-9B0A-AADEA183C2B3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E62ED84-8792-4DA6-9B0A-AADEA183C2B3}.Release|Any CPU.Build.0 = Release|Any CPU {6E6A7554-3488-45AB-BC0E-9BDE1F19789D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6E6A7554-3488-45AB-BC0E-9BDE1F19789D}.Debug|Any CPU.Build.0 = Debug|Any CPU {6E6A7554-3488-45AB-BC0E-9BDE1F19789D}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -790,6 +782,14 @@ Global {76D24E2C-8DB0-48B7-9FC4-02231B8B9F39}.Debug|Any CPU.Build.0 = Debug|Any CPU {76D24E2C-8DB0-48B7-9FC4-02231B8B9F39}.Release|Any CPU.ActiveCfg = Release|Any CPU {76D24E2C-8DB0-48B7-9FC4-02231B8B9F39}.Release|Any CPU.Build.0 = Release|Any CPU + {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}.Release|Any CPU.Build.0 = Release|Any CPU + {E4AB8A4F-BB59-4BDB-B915-877CE97D8113}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E4AB8A4F-BB59-4BDB-B915-877CE97D8113}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4AB8A4F-BB59-4BDB-B915-877CE97D8113}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E4AB8A4F-BB59-4BDB-B915-877CE97D8113}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -858,8 +858,6 @@ Global {A8C8B76D-0869-4C11-AC55-DB9DD115788E} = {37087D1B-3693-4E96-983D-A69F210BDE53} {DB012309-74FD-4D5A-B843-DD77BF053BF4} = {3B481ACC-5BB3-4189-880C-5F7A27EAEB70} {F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B} = {DB012309-74FD-4D5A-B843-DD77BF053BF4} - {723709F9-09FB-4715-A5D2-DAC8833D8CF7} = {DB012309-74FD-4D5A-B843-DD77BF053BF4} - {3E62ED84-8792-4DA6-9B0A-AADEA183C2B3} = {DB012309-74FD-4D5A-B843-DD77BF053BF4} {6E6A7554-3488-45AB-BC0E-9BDE1F19789D} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} {F79B6D80-C79B-4C13-9221-CA2345983743} = {37087D1B-3693-4E96-983D-A69F210BDE53} {A7A97BFD-48FA-45D1-8423-031BA30BEAA1} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} @@ -936,6 +934,8 @@ Global {258B4E36-BF5B-484D-B10E-7D5AF868FA44} = {3510E248-DC9F-4A07-8134-02E7F5CC5783} {067627C7-6891-453A-A219-35141733D776} = {3510E248-DC9F-4A07-8134-02E7F5CC5783} {76D24E2C-8DB0-48B7-9FC4-02231B8B9F39} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6} + {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A} = {3510E248-DC9F-4A07-8134-02E7F5CC5783} + {E4AB8A4F-BB59-4BDB-B915-877CE97D8113} = {DB012309-74FD-4D5A-B843-DD77BF053BF4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContext.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContext.cs new file mode 100644 index 0000000000..91cc8c9745 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContext.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.IdentityServer.EntityFrameworkCore; + +namespace MicroserviceDemo.AuthServer.Db +{ + public class MigrationDbContext : AbpDbContext + { + public MigrationDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureIdentityServer(); + } + } +} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContextFactory.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContextFactory.cs new file mode 100644 index 0000000000..d0dc04aad0 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContextFactory.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; + +namespace MicroserviceDemo.AuthServer.Db +{ + /* This class is needed for EF Core command line tooling */ + + public class MigrationDbContextFactory : IDesignTimeDbContextFactory + { + public MigrationDbContext CreateDbContext(string[] args) + { + var builder = new DbContextOptionsBuilder(); + builder.UseSqlServer("Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true"); + return new MigrationDbContext(builder.Options); + } + } +} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroserviceDemo.AuthServer.csproj b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroserviceDemo.AuthServer.csproj new file mode 100644 index 0000000000..3661de16dd --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroserviceDemo.AuthServer.csproj @@ -0,0 +1,31 @@ + + + + netcoreapp2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs new file mode 100644 index 0000000000..28837b8d08 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs @@ -0,0 +1,74 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Account.Web; +using Volo.Abp.AspNetCore.Modularity; +using Volo.Abp.Autofac; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.IdentityServer.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace MicroserviceDemo.AuthServer +{ + [DependsOn(typeof(AbpAutofacModule))] + [DependsOn(typeof(AbpIdentityEntityFrameworkCoreModule))] + [DependsOn(typeof(AbpIdentityServerEntityFrameworkCoreModule))] + [DependsOn(typeof(AbpAccountWebIdentityServerModule))] + public class MicroservicesAuthServerModule : AbpModule + { + public override void ConfigureServices(IServiceCollection services) + { + var hostingEnvironment = services.GetSingletonInstance(); + var configuration = BuildConfiguration(hostingEnvironment); + + services.Configure(configuration); + + services.Configure(options => + { + options.Configure(context => + { + if (context.ExistingConnection != null) + { + context.DbContextOptions.UseSqlServer(context.ExistingConnection); + } + else + { + context.DbContextOptions.UseSqlServer(context.ConnectionString); + } + }); + }); + + services.AddAssemblyOf(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + + if (context.GetEnvironment().IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseStaticFiles(); + app.UseVirtualFiles(); + + app.UseMvcWithDefaultRoute(); + } + + private static IConfigurationRoot BuildConfiguration(IHostingEnvironment env) + { + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); + + return builder.Build(); + } + } +} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.Designer.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.Designer.cs new file mode 100644 index 0000000000..d86373b34b --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.Designer.cs @@ -0,0 +1,526 @@ +// +using MicroserviceDemo.AuthServer.Db; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; +using System; + +namespace MicroserviceDemo.AuthServer.Migrations +{ + [DbContext(typeof(MigrationDbContext))] + [Migration("20180228110952_Added_IdentityServer_Module")] + partial class Added_IdentityServer_Module + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.0.1-rtm-125") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasMaxLength(200); + + b.Property("Enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId"); + + b.Property("Type") + .HasMaxLength(196); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId"); + + b.Property("Name") + .HasMaxLength(196); + + b.Property("Description") + .HasMaxLength(256); + + b.Property("DisplayName") + .HasMaxLength(128); + + b.Property("Emphasize"); + + b.Property("Required"); + + b.Property("ShowInDiscoveryDocument"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId"); + + b.Property("Name") + .HasMaxLength(196); + + b.Property("Type") + .HasMaxLength(196); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.Property("ApiResourceId"); + + b.Property("Type") + .HasMaxLength(32); + + b.Property("Value") + .HasMaxLength(196); + + b.Property("Description") + .HasMaxLength(256); + + b.Property("Expiration"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AbsoluteRefreshTokenLifetime"); + + b.Property("AccessTokenLifetime"); + + b.Property("AccessTokenType"); + + b.Property("AllowAccessTokensViaBrowser"); + + b.Property("AllowOfflineAccess"); + + b.Property("AllowPlainTextPkce"); + + b.Property("AllowRememberConsent"); + + b.Property("AlwaysIncludeUserClaimsInIdToken"); + + b.Property("AlwaysSendClientClaims"); + + b.Property("AuthorizationCodeLifetime"); + + b.Property("BackChannelLogoutSessionRequired"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200); + + b.Property("ClientName") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasMaxLength(2000); + + b.Property("ConsentLifetime"); + + b.Property("Description") + .HasMaxLength(1000); + + b.Property("EnableLocalLogin"); + + b.Property("Enabled"); + + b.Property("FrontChannelLogoutSessionRequired"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime"); + + b.Property("IncludeJwtId"); + + b.Property("LogoUri") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration"); + + b.Property("RefreshTokenUsage"); + + b.Property("RequireClientSecret"); + + b.Property("RequireConsent"); + + b.Property("RequirePkce"); + + b.Property("SlidingRefreshTokenLifetime"); + + b.Property("UpdateAccessTokenClaimsOnRefresh"); + + b.HasKey("Id"); + + b.HasIndex("ClientId") + .IsUnique(); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClientId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasMaxLength(250); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId"); + + b.Property("Origin") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId"); + + b.Property("GrantType") + .HasMaxLength(196); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId"); + + b.Property("Provider") + .HasMaxLength(64); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId"); + + b.Property("Key") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId"); + + b.Property("RedirectUri") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId"); + + b.Property("Scope") + .HasMaxLength(196); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId"); + + b.Property("Type") + .HasMaxLength(32); + + b.Property("Value") + .HasMaxLength(196); + + b.Property("Description") + .HasMaxLength(256); + + b.Property("Expiration"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200); + + b.Property("CreationTime"); + + b.Property("Data") + .IsRequired(); + + b.Property("Expiration"); + + b.Property("Id"); + + b.Property("SubjectId") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.Property("IdentityResourceId"); + + b.Property("Type") + .HasMaxLength(196); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasMaxLength(200); + + b.Property("Emphasize"); + + b.Property("Enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200); + + b.Property("Required"); + + b.Property("ShowInDiscoveryDocument"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope") + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource") + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.cs new file mode 100644 index 0000000000..3e26498034 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.cs @@ -0,0 +1,448 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using System; +using System.Collections.Generic; + +namespace MicroserviceDemo.AuthServer.Migrations +{ + public partial class Added_IdentityServer_Module : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "IdentityServerApiResources", + columns: table => new + { + Id = table.Column(nullable: false), + Description = table.Column(maxLength: 1000, nullable: true), + DisplayName = table.Column(maxLength: 200, nullable: true), + Enabled = table.Column(nullable: false), + Name = table.Column(maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClients", + columns: table => new + { + Id = table.Column(nullable: false), + AbsoluteRefreshTokenLifetime = table.Column(nullable: false), + AccessTokenLifetime = table.Column(nullable: false), + AccessTokenType = table.Column(nullable: false), + AllowAccessTokensViaBrowser = table.Column(nullable: false), + AllowOfflineAccess = table.Column(nullable: false), + AllowPlainTextPkce = table.Column(nullable: false), + AllowRememberConsent = table.Column(nullable: false), + AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false), + AlwaysSendClientClaims = table.Column(nullable: false), + AuthorizationCodeLifetime = table.Column(nullable: false), + BackChannelLogoutSessionRequired = table.Column(nullable: false), + BackChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), + ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + ClientName = table.Column(maxLength: 200, nullable: true), + ClientUri = table.Column(maxLength: 2000, nullable: true), + ConsentLifetime = table.Column(nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + EnableLocalLogin = table.Column(nullable: false), + Enabled = table.Column(nullable: false), + FrontChannelLogoutSessionRequired = table.Column(nullable: false), + FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), + IdentityTokenLifetime = table.Column(nullable: false), + IncludeJwtId = table.Column(nullable: false), + LogoUri = table.Column(maxLength: 2000, nullable: true), + PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), + ProtocolType = table.Column(maxLength: 200, nullable: false), + RefreshTokenExpiration = table.Column(nullable: false), + RefreshTokenUsage = table.Column(nullable: false), + RequireClientSecret = table.Column(nullable: false), + RequireConsent = table.Column(nullable: false), + RequirePkce = table.Column(nullable: false), + SlidingRefreshTokenLifetime = table.Column(nullable: false), + UpdateAccessTokenClaimsOnRefresh = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClients", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResources", + columns: table => new + { + Id = table.Column(nullable: false), + Description = table.Column(maxLength: 1000, nullable: true), + DisplayName = table.Column(maxLength: 200, nullable: true), + Emphasize = table.Column(nullable: false), + Enabled = table.Column(nullable: false), + Name = table.Column(maxLength: 200, nullable: false), + Required = table.Column(nullable: false), + ShowInDiscoveryDocument = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerPersistedGrants", + columns: table => new + { + Key = table.Column(maxLength: 200, nullable: false), + ClientId = table.Column(maxLength: 200, nullable: false), + CreationTime = table.Column(nullable: false), + Data = table.Column(nullable: false), + Expiration = table.Column(nullable: true), + Id = table.Column(nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + Type = table.Column(maxLength: 50, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiClaims", + columns: table => new + { + ApiResourceId = table.Column(nullable: false), + Type = table.Column(maxLength: 196, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopes", + columns: table => new + { + ApiResourceId = table.Column(nullable: false), + Name = table.Column(maxLength: 196, nullable: false), + Description = table.Column(maxLength: 256, nullable: true), + DisplayName = table.Column(maxLength: 128, nullable: true), + Emphasize = table.Column(nullable: false), + Required = table.Column(nullable: false), + ShowInDiscoveryDocument = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name }); + table.ForeignKey( + name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiSecrets", + columns: table => new + { + ApiResourceId = table.Column(nullable: false), + Type = table.Column(maxLength: 32, nullable: false), + Value = table.Column(maxLength: 196, nullable: false), + Description = table.Column(maxLength: 256, nullable: true), + Expiration = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientClaims", + columns: table => new + { + Id = table.Column(nullable: false), + ClientId = table.Column(nullable: false), + Type = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 250, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientClaims", x => x.Id); + table.ForeignKey( + name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientCorsOrigins", + columns: table => new + { + ClientId = table.Column(nullable: false), + Origin = table.Column(maxLength: 150, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); + table.ForeignKey( + name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientGrantTypes", + columns: table => new + { + ClientId = table.Column(nullable: false), + GrantType = table.Column(maxLength: 196, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); + table.ForeignKey( + name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientIdPRestrictions", + columns: table => new + { + ClientId = table.Column(nullable: false), + Provider = table.Column(maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); + table.ForeignKey( + name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientPostLogoutRedirectUris", + columns: table => new + { + ClientId = table.Column(nullable: false), + PostLogoutRedirectUri = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientProperties", + columns: table => new + { + ClientId = table.Column(nullable: false), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key }); + table.ForeignKey( + name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientRedirectUris", + columns: table => new + { + ClientId = table.Column(nullable: false), + RedirectUri = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientScopes", + columns: table => new + { + ClientId = table.Column(nullable: false), + Scope = table.Column(maxLength: 196, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientSecrets", + columns: table => new + { + ClientId = table.Column(nullable: false), + Type = table.Column(maxLength: 32, nullable: false), + Value = table.Column(maxLength: 196, nullable: false), + Description = table.Column(maxLength: 256, nullable: true), + Expiration = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityClaims", + columns: table => new + { + IdentityResourceId = table.Column(nullable: false), + Type = table.Column(maxLength: 196, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeClaims", + columns: table => new + { + ApiResourceId = table.Column(nullable: false), + Name = table.Column(maxLength: 196, nullable: false), + Type = table.Column(maxLength: 196, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiResourceId, x.Name, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiResourceId_Name", + columns: x => new { x.ApiResourceId, x.Name }, + principalTable: "IdentityServerApiScopes", + principalColumns: new[] { "ApiResourceId", "Name" }, + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerClientClaims_ClientId", + table: "IdentityServerClientClaims", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerClients_ClientId", + table: "IdentityServerClients", + column: "ClientId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "ClientId", "Type" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "IdentityServerApiClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerClientClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerClientCorsOrigins"); + + migrationBuilder.DropTable( + name: "IdentityServerClientGrantTypes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientIdPRestrictions"); + + migrationBuilder.DropTable( + name: "IdentityServerClientPostLogoutRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerClientRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerPersistedGrants"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClients"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResources"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResources"); + } + } +} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/MigrationDbContextModelSnapshot.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/MigrationDbContextModelSnapshot.cs new file mode 100644 index 0000000000..183eb51318 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/MigrationDbContextModelSnapshot.cs @@ -0,0 +1,525 @@ +// +using MicroserviceDemo.AuthServer.Db; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; +using System; + +namespace MicroserviceDemo.AuthServer.Migrations +{ + [DbContext(typeof(MigrationDbContext))] + partial class MigrationDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.0.1-rtm-125") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasMaxLength(200); + + b.Property("Enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId"); + + b.Property("Type") + .HasMaxLength(196); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId"); + + b.Property("Name") + .HasMaxLength(196); + + b.Property("Description") + .HasMaxLength(256); + + b.Property("DisplayName") + .HasMaxLength(128); + + b.Property("Emphasize"); + + b.Property("Required"); + + b.Property("ShowInDiscoveryDocument"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId"); + + b.Property("Name") + .HasMaxLength(196); + + b.Property("Type") + .HasMaxLength(196); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.Property("ApiResourceId"); + + b.Property("Type") + .HasMaxLength(32); + + b.Property("Value") + .HasMaxLength(196); + + b.Property("Description") + .HasMaxLength(256); + + b.Property("Expiration"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AbsoluteRefreshTokenLifetime"); + + b.Property("AccessTokenLifetime"); + + b.Property("AccessTokenType"); + + b.Property("AllowAccessTokensViaBrowser"); + + b.Property("AllowOfflineAccess"); + + b.Property("AllowPlainTextPkce"); + + b.Property("AllowRememberConsent"); + + b.Property("AlwaysIncludeUserClaimsInIdToken"); + + b.Property("AlwaysSendClientClaims"); + + b.Property("AuthorizationCodeLifetime"); + + b.Property("BackChannelLogoutSessionRequired"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200); + + b.Property("ClientName") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasMaxLength(2000); + + b.Property("ConsentLifetime"); + + b.Property("Description") + .HasMaxLength(1000); + + b.Property("EnableLocalLogin"); + + b.Property("Enabled"); + + b.Property("FrontChannelLogoutSessionRequired"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime"); + + b.Property("IncludeJwtId"); + + b.Property("LogoUri") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration"); + + b.Property("RefreshTokenUsage"); + + b.Property("RequireClientSecret"); + + b.Property("RequireConsent"); + + b.Property("RequirePkce"); + + b.Property("SlidingRefreshTokenLifetime"); + + b.Property("UpdateAccessTokenClaimsOnRefresh"); + + b.HasKey("Id"); + + b.HasIndex("ClientId") + .IsUnique(); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClientId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasMaxLength(250); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId"); + + b.Property("Origin") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId"); + + b.Property("GrantType") + .HasMaxLength(196); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId"); + + b.Property("Provider") + .HasMaxLength(64); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId"); + + b.Property("Key") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId"); + + b.Property("RedirectUri") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId"); + + b.Property("Scope") + .HasMaxLength(196); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId"); + + b.Property("Type") + .HasMaxLength(32); + + b.Property("Value") + .HasMaxLength(196); + + b.Property("Description") + .HasMaxLength(256); + + b.Property("Expiration"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200); + + b.Property("CreationTime"); + + b.Property("Data") + .IsRequired(); + + b.Property("Expiration"); + + b.Property("Id"); + + b.Property("SubjectId") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.Property("IdentityResourceId"); + + b.Property("Type") + .HasMaxLength(196); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasMaxLength(200); + + b.Property("Emphasize"); + + b.Property("Enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200); + + b.Property("Required"); + + b.Property("ShowInDiscoveryDocument"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope") + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client") + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource") + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Program.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Program.cs new file mode 100644 index 0000000000..ebf3acc400 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Program.cs @@ -0,0 +1,21 @@ +using System.IO; +using Microsoft.AspNetCore.Hosting; + +namespace MicroserviceDemo.AuthServer +{ + public class Program + { + public static void Main(string[] args) + { + BuildWebHostInternal(args).Run(); + } + + public static IWebHost BuildWebHostInternal(string[] args) => + new WebHostBuilder() + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .Build(); + } +} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json new file mode 100644 index 0000000000..abf272fae8 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:54307/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "MicroserviceDemo.AuthServer": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:54308/" + } + } +} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Startup.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Startup.cs new file mode 100644 index 0000000000..e976a59d57 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Startup.cs @@ -0,0 +1,36 @@ +using System; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Serilog; +using Volo.Abp; + +namespace MicroserviceDemo.AuthServer +{ + public class Startup + { + public IServiceProvider ConfigureServices(IServiceCollection services) + { + services.AddApplication(options => + { + options.UseAutofac(); + }); + + return services.BuildServiceProviderFromFactory(); + } + + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) + { + loggerFactory + .AddConsole() + .AddDebug() + .AddSerilog(new LoggerConfiguration() + .Enrich.FromLogContext() + .WriteTo.RollingFile("Logs/logs.txt") + .CreateLogger() + ); + + app.InitializeApplication(); + } + } +} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json new file mode 100644 index 0000000000..a3a7ec3fb7 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json @@ -0,0 +1,5 @@ +{ + "ConnectionStrings": { + "Default": "Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true" + } +} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/tempkey.rsa b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/tempkey.rsa new file mode 100644 index 0000000000..56c077be19 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/tempkey.rsa @@ -0,0 +1 @@ +{"KeyId":"173073ce8d3c648d6b25c1b104a1e67b","Parameters":{"D":"a71rLomICvsQCd2KYGw552cks0Sv38mD2wCnMH1At0QLd1t05N5SOvaT3sfockDIuAj4zVHS9L+ZsU44GsOrZ1V8sMug2+ClfAA4K50tR9xdza0qP0xYlhANckBageQed+kFE6q7G/Sh6aG/6lClW/AW044sCyiguzw0HNylKUGPeet246TvKyJmNODYDBs1IvMd2qt/1vrGnk08bTn1CFCbQe7mhYlJLTrNHZWAADrc5/fykcz2SZ9tPwo/YiOWak7xYwYWgy+FAAr7H4r1WCrvRvB7Fr4+yABEZmPbCNSRgw30so8f/ve3S86xSEeZPvN4yfj9BPF601Yk8s+MJQ==","DP":"595opp9oLnJFqhn6/xgoAvayNLOY6zWKgfV8VCo6vwTrLcluIpWGTek9fVwedWUcAAoWUA/mCpsuA+AE19i35ymzdw910mONcHAzPQhr8zn50CeUZCQHJzGHxm11cBrcAguTW6coggxR84VfCR3a0sj6WssvVcVMPw8YSevwei8=","DQ":"hWy0c8gl6xRyVF6XEXaNIg4i1tPTYl/fW0Mq/Daf7X/89xoYPE/VGyhmrtQcTbZSQvja05UdLpAqmZuPiFo2IHS5DhreKkIJmC03gNg/2YsO3wkMpDB3Oz1y4d8E/l1dIR/BBaWs7qnr35lImY/mOq3pO2GFi/t4Eh+uH2rKGy0=","Exponent":"AQAB","InverseQ":"QMUZ9NCw0GvufYNej8qLVMeoLQmuLjjgzjyLpwSiLWZ3JbNt8b1Estngg/2uDIb68zzpyxBC/AIkFE7pVYX+OvGv4N4KsWZJ7cKwyIzh8lsvlsvJNCEEujQN/Pk9e9GNUYwK7xNpn4BErwvpVtgMHBHV+sml80tLu/yOVx7kTio=","Modulus":"uy3Om+Lq9YlGDD1ZkoAL3CXzIs2GPkRc5QAvPY/Gsy1mCqyhwr3Olz7FsceL1UEs8A6ON0WfZNrqci+U5DxU2WmMM0ePLlchxCt84ykY4P2u/7b6kTsnzfLRUawBEuruUmVafI39C7tV0I+3qIq1wUN7QeGpl5cjHkQ5ovb+ph0F46+LD7b5YWY9/yjSmlTFFS79r/DOf925VCryry290YO9qDeXNQEgjxqjotiIJkSp4WzdkQCN+yl67HJtzarNkx9vhEie9qp5S6YZB/vD5C8qo6TOMGtTfBO+gOLIorkv6la9WFivBaVFUwXxRJFysjcKDSgiurIZ4Y0TbgMIpQ==","P":"9/0HEaJwP0cxiYJYoZvJ62X2f023k/CzLFrq2t3GhxlDgLtHpPC5xhpTX6onou9D/USjQj02e/E2nsEwxlDjeDrVbX+fFXvKSnItMzavyjcgJfkkdUNJvx9VPy9t74hVPyDUmBjqscABVhJEd43hXPELUy5nHoVna/RZhmuJdgc=","Q":"wTnb0iMDzvTLvuHeK/PRewji8KOzx3588i1ndldjtdNS7+roOG8n681HYAl55SfWDij3cBYt+lnFbTPtD1zj1QXyx1nM0nw52WmudgC0lIupTU67UfnAXm4HThDCw/41pFy9snJxjGNOJ2EEmSXjnd0nEwL7FkKd3FwYv+84APM="}} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroserviceDemo.TenancyService.csproj b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroserviceDemo.TenancyService.csproj index ffa2210807..0f2edd9d52 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroserviceDemo.TenancyService.csproj +++ b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroserviceDemo.TenancyService.csproj @@ -4,6 +4,13 @@ netcoreapp2.0 + + + + + + + diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroserviceDemo.Web.csproj b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroserviceDemo.Web.csproj index fb77c8a5a1..ce06bc6d7a 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroserviceDemo.Web.csproj +++ b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroserviceDemo.Web.csproj @@ -5,6 +5,13 @@ ..\docker-compose.dcproj + + + + + + + @@ -19,7 +26,6 @@ - diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs index 5120038e4d..7b91f3de5a 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs +++ b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs @@ -77,7 +77,6 @@ namespace MicroserviceDemo.Web services.AddAuthentication(); - services.AddHttpClientProxies(typeof(AbpPermissionsApplicationContractsModule).Assembly, "AbpPermissions"); //TODO: Create permission http client module and remove this one services.Configure(configuration); services.AddSwaggerGen( diff --git a/src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj b/src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj deleted file mode 100644 index 9b0906e5de..0000000000 --- a/src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Account.Application.Contracts - Volo.Abp.Account.Application.Contracts - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - diff --git a/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs b/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs deleted file mode 100644 index eb7b505cf2..0000000000 --- a/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Account -{ - [DependsOn(typeof(AbpCommonModule))] - [DependsOn(typeof(AbpDddModule))] - public class AbpAccountApplicationContractsModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/ILoginAppService.cs b/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/ILoginAppService.cs deleted file mode 100644 index 1bd1be4a17..0000000000 --- a/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/ILoginAppService.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Volo.Abp.Application.Services; - -namespace Volo.Abp.Account -{ - public interface ILoginAppService : IApplicationService - { - } -} diff --git a/src/Volo.Abp.Account.Application/Volo.Abp.Account.Application.csproj b/src/Volo.Abp.Account.Application/Volo.Abp.Account.Application.csproj deleted file mode 100644 index bc878d5ec8..0000000000 --- a/src/Volo.Abp.Account.Application/Volo.Abp.Account.Application.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Account.Application - Volo.Abp.Account.Application - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - diff --git a/src/Volo.Abp.Account.Application/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs b/src/Volo.Abp.Account.Application/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs deleted file mode 100644 index 9b86e5b95f..0000000000 --- a/src/Volo.Abp.Account.Application/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Account -{ - [DependsOn(typeof(AbpAccountApplicationContractsModule))] - public class AbpAccountApplicationModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Account.Application/Volo/Abp/Account/LoginAppService.cs b/src/Volo.Abp.Account.Application/Volo/Abp/Account/LoginAppService.cs deleted file mode 100644 index 6aa9f57d01..0000000000 --- a/src/Volo.Abp.Account.Application/Volo/Abp/Account/LoginAppService.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Volo.Abp.Account -{ - public class LoginAppService : ILoginAppService - { - } -} diff --git a/src/Volo.Abp.Account.Web.IdentityServer/AbpAccountWebIdentityServerModule.cs b/src/Volo.Abp.Account.Web.IdentityServer/AbpAccountWebIdentityServerModule.cs new file mode 100644 index 0000000000..14e5100045 --- /dev/null +++ b/src/Volo.Abp.Account.Web.IdentityServer/AbpAccountWebIdentityServerModule.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace Volo.Abp.Account.Web +{ + [DependsOn(typeof(AbpAccountWebModule))] + public class AbpAccountWebIdentityServerModule : AbpModule + { + public override void ConfigureServices(IServiceCollection services) + { + services.AddAssemblyOf(); + + services.Configure(options => + { + options.FileSets.AddEmbedded("Volo.Abp.Account.Web"); + }); + } + } +} diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Properties/launchSettings.json b/src/Volo.Abp.Account.Web.IdentityServer/Properties/launchSettings.json new file mode 100644 index 0000000000..9201292f23 --- /dev/null +++ b/src/Volo.Abp.Account.Web.IdentityServer/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:55202/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.Account.Web.IdentityServer": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:55203/" + } + } +} \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj b/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj new file mode 100644 index 0000000000..5bedcf9979 --- /dev/null +++ b/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj @@ -0,0 +1,31 @@ + + + + + + netstandard2.0 + Volo.Abp.Account.Web.IdentityServer + Volo.Abp.Account.Web.IdentityServer + true + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + Volo.Abp.Account.Web + Library + + + + + + + + + + + + + + + + diff --git a/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs b/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs index 5f5b59d58c..a0df66f747 100644 --- a/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs +++ b/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs @@ -8,7 +8,6 @@ namespace Volo.Abp.Account.Web { [DependsOn(typeof(AbpIdentityDomainModule))] [DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))] - [DependsOn(typeof(AbpAccountApplicationContractsModule))] public class AbpAccountWebModule : AbpModule { public override void ConfigureServices(IServiceCollection services) diff --git a/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj b/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj index 3b9ed352b4..6073769fc4 100644 --- a/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj +++ b/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj @@ -20,13 +20,8 @@ - - - - - diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs index 66b733789a..58c1de9d38 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs @@ -1,5 +1,6 @@ using System; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.EmbeddedFiles; using Volo.Abp.AspNetCore.Mvc.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Localization.Resources.AbpBootstrap; using Volo.Abp.Localization; @@ -9,6 +10,7 @@ using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap { [DependsOn(typeof(AbpAspNetCoreMvcUiModule))] + [DependsOn(typeof(AbpAspNetCoreEmbeddedFilesModule))] public class AbpAspNetCoreMvcUiBootstrapModule : AbpModule { public override void ConfigureServices(IServiceCollection services) diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Pages/_ViewImports.cshtml b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Pages/_ViewImports.cshtml similarity index 100% rename from src/MicroserviceDemo/MicroserviceDemo.Web/Pages/_ViewImports.cshtml rename to src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Pages/_ViewImports.cshtml diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Pages/_ViewStart.cshtml b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Pages/_ViewStart.cshtml similarity index 100% rename from src/MicroserviceDemo/MicroserviceDemo.Web/Pages/_ViewStart.cshtml rename to src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Pages/_ViewStart.cshtml diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Views/_ViewImports.cshtml b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/_ViewImports.cshtml similarity index 100% rename from src/MicroserviceDemo/MicroserviceDemo.Web/Views/_ViewImports.cshtml rename to src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/_ViewImports.cshtml diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Views/_ViewStart.cshtml b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/_ViewStart.cshtml similarity index 100% rename from src/MicroserviceDemo/MicroserviceDemo.Web/Views/_ViewStart.cshtml rename to src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/_ViewStart.cshtml diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj index febca40330..bf33a9649c 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj @@ -14,10 +14,12 @@ + +