mirror of https://github.com/abpframework/abp.git
34 changed files with 1843 additions and 106 deletions
@ -0,0 +1,21 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
using Volo.Abp.IdentityServer.EntityFrameworkCore; |
||||
|
|
||||
|
namespace MicroserviceDemo.AuthServer.Db |
||||
|
{ |
||||
|
public class MigrationDbContext : AbpDbContext<MigrationDbContext> |
||||
|
{ |
||||
|
public MigrationDbContext(DbContextOptions<MigrationDbContext> options) |
||||
|
: base(options) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
base.OnModelCreating(modelBuilder); |
||||
|
|
||||
|
modelBuilder.ConfigureIdentityServer(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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<MigrationDbContext> |
||||
|
{ |
||||
|
public MigrationDbContext CreateDbContext(string[] args) |
||||
|
{ |
||||
|
var builder = new DbContextOptionsBuilder<MigrationDbContext>(); |
||||
|
builder.UseSqlServer("Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true"); |
||||
|
return new MigrationDbContext(builder.Options); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk.Web"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netcoreapp2.0</TargetFramework> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<Compile Remove="Logs\**" /> |
||||
|
<Content Remove="Logs\**" /> |
||||
|
<EmbeddedResource Remove="Logs\**" /> |
||||
|
<None Remove="Logs\**" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<Folder Include="wwwroot\" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" /> |
||||
|
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" /> |
||||
|
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\..\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" /> |
||||
|
<ProjectReference Include="..\..\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> |
||||
|
<ProjectReference Include="..\..\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" /> |
||||
|
<ProjectReference Include="..\..\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -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<IHostingEnvironment>(); |
||||
|
var configuration = BuildConfiguration(hostingEnvironment); |
||||
|
|
||||
|
services.Configure<DbConnectionOptions>(configuration); |
||||
|
|
||||
|
services.Configure<AbpDbContextOptions>(options => |
||||
|
{ |
||||
|
options.Configure(context => |
||||
|
{ |
||||
|
if (context.ExistingConnection != null) |
||||
|
{ |
||||
|
context.DbContextOptions.UseSqlServer(context.ExistingConnection); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
context.DbContextOptions.UseSqlServer(context.ConnectionString); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
services.AddAssemblyOf<MicroservicesAuthServerModule>(); |
||||
|
} |
||||
|
|
||||
|
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(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,526 @@ |
|||||
|
// <auto-generated />
|
||||
|
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<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(1000); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<bool>("Enabled"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiResources"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ApiResourceId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("ApiResourceId", "Type"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ApiResourceId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<bool>("Emphasize"); |
||||
|
|
||||
|
b.Property<bool>("Required"); |
||||
|
|
||||
|
b.Property<bool>("ShowInDiscoveryDocument"); |
||||
|
|
||||
|
b.HasKey("ApiResourceId", "Name"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiScopes"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ApiResourceId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("ApiResourceId", "Name", "Type"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiScopeClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ApiResourceId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(32); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<DateTime?>("Expiration"); |
||||
|
|
||||
|
b.HasKey("ApiResourceId", "Type", "Value"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiSecrets"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<int>("AbsoluteRefreshTokenLifetime"); |
||||
|
|
||||
|
b.Property<int>("AccessTokenLifetime"); |
||||
|
|
||||
|
b.Property<int>("AccessTokenType"); |
||||
|
|
||||
|
b.Property<bool>("AllowAccessTokensViaBrowser"); |
||||
|
|
||||
|
b.Property<bool>("AllowOfflineAccess"); |
||||
|
|
||||
|
b.Property<bool>("AllowPlainTextPkce"); |
||||
|
|
||||
|
b.Property<bool>("AllowRememberConsent"); |
||||
|
|
||||
|
b.Property<bool>("AlwaysIncludeUserClaimsInIdToken"); |
||||
|
|
||||
|
b.Property<bool>("AlwaysSendClientClaims"); |
||||
|
|
||||
|
b.Property<int>("AuthorizationCodeLifetime"); |
||||
|
|
||||
|
b.Property<bool>("BackChannelLogoutSessionRequired"); |
||||
|
|
||||
|
b.Property<string>("BackChannelLogoutUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.Property<string>("ClientClaimsPrefix") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ClientId") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ClientName") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ClientUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.Property<int?>("ConsentLifetime"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(1000); |
||||
|
|
||||
|
b.Property<bool>("EnableLocalLogin"); |
||||
|
|
||||
|
b.Property<bool>("Enabled"); |
||||
|
|
||||
|
b.Property<bool>("FrontChannelLogoutSessionRequired"); |
||||
|
|
||||
|
b.Property<string>("FrontChannelLogoutUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.Property<int>("IdentityTokenLifetime"); |
||||
|
|
||||
|
b.Property<bool>("IncludeJwtId"); |
||||
|
|
||||
|
b.Property<string>("LogoUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.Property<string>("PairWiseSubjectSalt") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ProtocolType") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<int>("RefreshTokenExpiration"); |
||||
|
|
||||
|
b.Property<int>("RefreshTokenUsage"); |
||||
|
|
||||
|
b.Property<bool>("RequireClientSecret"); |
||||
|
|
||||
|
b.Property<bool>("RequireConsent"); |
||||
|
|
||||
|
b.Property<bool>("RequirePkce"); |
||||
|
|
||||
|
b.Property<int>("SlidingRefreshTokenLifetime"); |
||||
|
|
||||
|
b.Property<bool>("UpdateAccessTokenClaimsOnRefresh"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("ClientId") |
||||
|
.IsUnique(); |
||||
|
|
||||
|
b.ToTable("IdentityServerClients"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(250); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(250); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("ClientId"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Origin") |
||||
|
.HasMaxLength(150); |
||||
|
|
||||
|
b.HasKey("ClientId", "Origin"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientCorsOrigins"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("GrantType") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("ClientId", "GrantType"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientGrantTypes"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Provider") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.HasKey("ClientId", "Provider"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientIdPRestrictions"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("PostLogoutRedirectUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.HasKey("ClientId", "PostLogoutRedirectUri"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientPostLogoutRedirectUris"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Key") |
||||
|
.HasMaxLength(250); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.HasKey("ClientId", "Key"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientProperties"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("RedirectUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.HasKey("ClientId", "RedirectUri"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientRedirectUris"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Scope") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("ClientId", "Scope"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientScopes"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(32); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<DateTime?>("Expiration"); |
||||
|
|
||||
|
b.HasKey("ClientId", "Type", "Value"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientSecrets"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => |
||||
|
{ |
||||
|
b.Property<string>("Key") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ClientId") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime"); |
||||
|
|
||||
|
b.Property<string>("Data") |
||||
|
.IsRequired(); |
||||
|
|
||||
|
b.Property<DateTime?>("Expiration"); |
||||
|
|
||||
|
b.Property<Guid>("Id"); |
||||
|
|
||||
|
b.Property<string>("SubjectId") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("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<Guid>("IdentityResourceId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("IdentityResourceId", "Type"); |
||||
|
|
||||
|
b.ToTable("IdentityServerIdentityClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(1000); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<bool>("Emphasize"); |
||||
|
|
||||
|
b.Property<bool>("Enabled"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<bool>("Required"); |
||||
|
|
||||
|
b.Property<bool>("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
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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<Guid>(nullable: false), |
||||
|
Description = table.Column<string>(maxLength: 1000, nullable: true), |
||||
|
DisplayName = table.Column<string>(maxLength: 200, nullable: true), |
||||
|
Enabled = table.Column<bool>(nullable: false), |
||||
|
Name = table.Column<string>(maxLength: 200, nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "IdentityServerClients", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(nullable: false), |
||||
|
AbsoluteRefreshTokenLifetime = table.Column<int>(nullable: false), |
||||
|
AccessTokenLifetime = table.Column<int>(nullable: false), |
||||
|
AccessTokenType = table.Column<int>(nullable: false), |
||||
|
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false), |
||||
|
AllowOfflineAccess = table.Column<bool>(nullable: false), |
||||
|
AllowPlainTextPkce = table.Column<bool>(nullable: false), |
||||
|
AllowRememberConsent = table.Column<bool>(nullable: false), |
||||
|
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false), |
||||
|
AlwaysSendClientClaims = table.Column<bool>(nullable: false), |
||||
|
AuthorizationCodeLifetime = table.Column<int>(nullable: false), |
||||
|
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false), |
||||
|
BackChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true), |
||||
|
ClientClaimsPrefix = table.Column<string>(maxLength: 200, nullable: true), |
||||
|
ClientId = table.Column<string>(maxLength: 200, nullable: false), |
||||
|
ClientName = table.Column<string>(maxLength: 200, nullable: true), |
||||
|
ClientUri = table.Column<string>(maxLength: 2000, nullable: true), |
||||
|
ConsentLifetime = table.Column<int>(nullable: true), |
||||
|
Description = table.Column<string>(maxLength: 1000, nullable: true), |
||||
|
EnableLocalLogin = table.Column<bool>(nullable: false), |
||||
|
Enabled = table.Column<bool>(nullable: false), |
||||
|
FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false), |
||||
|
FrontChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true), |
||||
|
IdentityTokenLifetime = table.Column<int>(nullable: false), |
||||
|
IncludeJwtId = table.Column<bool>(nullable: false), |
||||
|
LogoUri = table.Column<string>(maxLength: 2000, nullable: true), |
||||
|
PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true), |
||||
|
ProtocolType = table.Column<string>(maxLength: 200, nullable: false), |
||||
|
RefreshTokenExpiration = table.Column<int>(nullable: false), |
||||
|
RefreshTokenUsage = table.Column<int>(nullable: false), |
||||
|
RequireClientSecret = table.Column<bool>(nullable: false), |
||||
|
RequireConsent = table.Column<bool>(nullable: false), |
||||
|
RequirePkce = table.Column<bool>(nullable: false), |
||||
|
SlidingRefreshTokenLifetime = table.Column<int>(nullable: false), |
||||
|
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_IdentityServerClients", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "IdentityServerIdentityResources", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(nullable: false), |
||||
|
Description = table.Column<string>(maxLength: 1000, nullable: true), |
||||
|
DisplayName = table.Column<string>(maxLength: 200, nullable: true), |
||||
|
Emphasize = table.Column<bool>(nullable: false), |
||||
|
Enabled = table.Column<bool>(nullable: false), |
||||
|
Name = table.Column<string>(maxLength: 200, nullable: false), |
||||
|
Required = table.Column<bool>(nullable: false), |
||||
|
ShowInDiscoveryDocument = table.Column<bool>(nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "IdentityServerPersistedGrants", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Key = table.Column<string>(maxLength: 200, nullable: false), |
||||
|
ClientId = table.Column<string>(maxLength: 200, nullable: false), |
||||
|
CreationTime = table.Column<DateTime>(nullable: false), |
||||
|
Data = table.Column<string>(nullable: false), |
||||
|
Expiration = table.Column<DateTime>(nullable: true), |
||||
|
Id = table.Column<Guid>(nullable: false), |
||||
|
SubjectId = table.Column<string>(maxLength: 200, nullable: true), |
||||
|
Type = table.Column<string>(maxLength: 50, nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "IdentityServerApiClaims", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
ApiResourceId = table.Column<Guid>(nullable: false), |
||||
|
Type = table.Column<string>(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<Guid>(nullable: false), |
||||
|
Name = table.Column<string>(maxLength: 196, nullable: false), |
||||
|
Description = table.Column<string>(maxLength: 256, nullable: true), |
||||
|
DisplayName = table.Column<string>(maxLength: 128, nullable: true), |
||||
|
Emphasize = table.Column<bool>(nullable: false), |
||||
|
Required = table.Column<bool>(nullable: false), |
||||
|
ShowInDiscoveryDocument = table.Column<bool>(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<Guid>(nullable: false), |
||||
|
Type = table.Column<string>(maxLength: 32, nullable: false), |
||||
|
Value = table.Column<string>(maxLength: 196, nullable: false), |
||||
|
Description = table.Column<string>(maxLength: 256, nullable: true), |
||||
|
Expiration = table.Column<DateTime>(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<Guid>(nullable: false), |
||||
|
ClientId = table.Column<Guid>(nullable: false), |
||||
|
Type = table.Column<string>(maxLength: 250, nullable: false), |
||||
|
Value = table.Column<string>(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<Guid>(nullable: false), |
||||
|
Origin = table.Column<string>(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<Guid>(nullable: false), |
||||
|
GrantType = table.Column<string>(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<Guid>(nullable: false), |
||||
|
Provider = table.Column<string>(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<Guid>(nullable: false), |
||||
|
PostLogoutRedirectUri = table.Column<string>(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<Guid>(nullable: false), |
||||
|
Key = table.Column<string>(maxLength: 250, nullable: false), |
||||
|
Value = table.Column<string>(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<Guid>(nullable: false), |
||||
|
RedirectUri = table.Column<string>(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<Guid>(nullable: false), |
||||
|
Scope = table.Column<string>(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<Guid>(nullable: false), |
||||
|
Type = table.Column<string>(maxLength: 32, nullable: false), |
||||
|
Value = table.Column<string>(maxLength: 196, nullable: false), |
||||
|
Description = table.Column<string>(maxLength: 256, nullable: true), |
||||
|
Expiration = table.Column<DateTime>(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<Guid>(nullable: false), |
||||
|
Type = table.Column<string>(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<Guid>(nullable: false), |
||||
|
Name = table.Column<string>(maxLength: 196, nullable: false), |
||||
|
Type = table.Column<string>(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"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,525 @@ |
|||||
|
// <auto-generated />
|
||||
|
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<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(1000); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<bool>("Enabled"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiResources"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ApiResourceId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("ApiResourceId", "Type"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ApiResourceId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<bool>("Emphasize"); |
||||
|
|
||||
|
b.Property<bool>("Required"); |
||||
|
|
||||
|
b.Property<bool>("ShowInDiscoveryDocument"); |
||||
|
|
||||
|
b.HasKey("ApiResourceId", "Name"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiScopes"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ApiResourceId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("ApiResourceId", "Name", "Type"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiScopeClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ApiResourceId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(32); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<DateTime?>("Expiration"); |
||||
|
|
||||
|
b.HasKey("ApiResourceId", "Type", "Value"); |
||||
|
|
||||
|
b.ToTable("IdentityServerApiSecrets"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<int>("AbsoluteRefreshTokenLifetime"); |
||||
|
|
||||
|
b.Property<int>("AccessTokenLifetime"); |
||||
|
|
||||
|
b.Property<int>("AccessTokenType"); |
||||
|
|
||||
|
b.Property<bool>("AllowAccessTokensViaBrowser"); |
||||
|
|
||||
|
b.Property<bool>("AllowOfflineAccess"); |
||||
|
|
||||
|
b.Property<bool>("AllowPlainTextPkce"); |
||||
|
|
||||
|
b.Property<bool>("AllowRememberConsent"); |
||||
|
|
||||
|
b.Property<bool>("AlwaysIncludeUserClaimsInIdToken"); |
||||
|
|
||||
|
b.Property<bool>("AlwaysSendClientClaims"); |
||||
|
|
||||
|
b.Property<int>("AuthorizationCodeLifetime"); |
||||
|
|
||||
|
b.Property<bool>("BackChannelLogoutSessionRequired"); |
||||
|
|
||||
|
b.Property<string>("BackChannelLogoutUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.Property<string>("ClientClaimsPrefix") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ClientId") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ClientName") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ClientUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.Property<int?>("ConsentLifetime"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(1000); |
||||
|
|
||||
|
b.Property<bool>("EnableLocalLogin"); |
||||
|
|
||||
|
b.Property<bool>("Enabled"); |
||||
|
|
||||
|
b.Property<bool>("FrontChannelLogoutSessionRequired"); |
||||
|
|
||||
|
b.Property<string>("FrontChannelLogoutUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.Property<int>("IdentityTokenLifetime"); |
||||
|
|
||||
|
b.Property<bool>("IncludeJwtId"); |
||||
|
|
||||
|
b.Property<string>("LogoUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.Property<string>("PairWiseSubjectSalt") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ProtocolType") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<int>("RefreshTokenExpiration"); |
||||
|
|
||||
|
b.Property<int>("RefreshTokenUsage"); |
||||
|
|
||||
|
b.Property<bool>("RequireClientSecret"); |
||||
|
|
||||
|
b.Property<bool>("RequireConsent"); |
||||
|
|
||||
|
b.Property<bool>("RequirePkce"); |
||||
|
|
||||
|
b.Property<int>("SlidingRefreshTokenLifetime"); |
||||
|
|
||||
|
b.Property<bool>("UpdateAccessTokenClaimsOnRefresh"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("ClientId") |
||||
|
.IsUnique(); |
||||
|
|
||||
|
b.ToTable("IdentityServerClients"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(250); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(250); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("ClientId"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Origin") |
||||
|
.HasMaxLength(150); |
||||
|
|
||||
|
b.HasKey("ClientId", "Origin"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientCorsOrigins"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("GrantType") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("ClientId", "GrantType"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientGrantTypes"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Provider") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.HasKey("ClientId", "Provider"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientIdPRestrictions"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("PostLogoutRedirectUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.HasKey("ClientId", "PostLogoutRedirectUri"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientPostLogoutRedirectUris"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Key") |
||||
|
.HasMaxLength(250); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.HasKey("ClientId", "Key"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientProperties"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("RedirectUri") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.HasKey("ClientId", "RedirectUri"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientRedirectUris"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Scope") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("ClientId", "Scope"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientScopes"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => |
||||
|
{ |
||||
|
b.Property<Guid>("ClientId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(32); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<DateTime?>("Expiration"); |
||||
|
|
||||
|
b.HasKey("ClientId", "Type", "Value"); |
||||
|
|
||||
|
b.ToTable("IdentityServerClientSecrets"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => |
||||
|
{ |
||||
|
b.Property<string>("Key") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("ClientId") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime"); |
||||
|
|
||||
|
b.Property<string>("Data") |
||||
|
.IsRequired(); |
||||
|
|
||||
|
b.Property<DateTime?>("Expiration"); |
||||
|
|
||||
|
b.Property<Guid>("Id"); |
||||
|
|
||||
|
b.Property<string>("SubjectId") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<string>("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<Guid>("IdentityResourceId"); |
||||
|
|
||||
|
b.Property<string>("Type") |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.HasKey("IdentityResourceId", "Type"); |
||||
|
|
||||
|
b.ToTable("IdentityServerIdentityClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(1000); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<bool>("Emphasize"); |
||||
|
|
||||
|
b.Property<bool>("Enabled"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(200); |
||||
|
|
||||
|
b.Property<bool>("Required"); |
||||
|
|
||||
|
b.Property<bool>("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
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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<Startup>() |
||||
|
.Build(); |
||||
|
} |
||||
|
} |
||||
@ -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/" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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<MicroservicesAuthServerModule>(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(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,5 @@ |
|||||
|
{ |
||||
|
"ConnectionStrings": { |
||||
|
"Default": "Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true" |
||||
|
} |
||||
|
} |
||||
@ -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="}} |
||||
@ -1,21 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<Import Project="..\..\common.props" /> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netstandard2.0</TargetFramework> |
|
||||
<AssemblyName>Volo.Abp.Account.Application.Contracts</AssemblyName> |
|
||||
<PackageId>Volo.Abp.Account.Application.Contracts</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|
||||
<RootNamespace /> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\Volo.Abp.Ddd\Volo.Abp.Ddd.csproj" /> |
|
||||
<ProjectReference Include="..\Volo.Abp\Volo.Abp.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -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<AbpAccountApplicationContractsModule>(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,8 +0,0 @@ |
|||||
using Volo.Abp.Application.Services; |
|
||||
|
|
||||
namespace Volo.Abp.Account |
|
||||
{ |
|
||||
public interface ILoginAppService : IApplicationService |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
@ -1,20 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<Import Project="..\..\common.props" /> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netstandard2.0</TargetFramework> |
|
||||
<AssemblyName>Volo.Abp.Account.Application</AssemblyName> |
|
||||
<PackageId>Volo.Abp.Account.Application</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|
||||
<RootNamespace /> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\Volo.Abp.Account.Application.Contracts\Volo.Abp.Account.Application.Contracts.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -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<AbpAccountApplicationModule>(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,6 +0,0 @@ |
|||||
namespace Volo.Abp.Account |
|
||||
{ |
|
||||
public class LoginAppService : ILoginAppService |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
@ -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<AbpAccountWebModule>(); |
||||
|
|
||||
|
services.Configure<VirtualFileSystemOptions>(options => |
||||
|
{ |
||||
|
options.FileSets.AddEmbedded<AbpAccountWebModule>("Volo.Abp.Account.Web"); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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/" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk.Web"> |
||||
|
|
||||
|
<Import Project="..\..\common.props" /> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netstandard2.0</TargetFramework> |
||||
|
<AssemblyName>Volo.Abp.Account.Web.IdentityServer</AssemblyName> |
||||
|
<PackageId>Volo.Abp.Account.Web.IdentityServer</PackageId> |
||||
|
<IsPackable>true</IsPackable> |
||||
|
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
||||
|
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
||||
|
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
||||
|
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
||||
|
<RootNamespace>Volo.Abp.Account.Web</RootNamespace> |
||||
|
<OutputType>Library</OutputType> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<EmbeddedResource Include="Pages\**\*.*" Exclude="*.cs" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<Folder Include="Areas\Account\Controllers\" /> |
||||
|
<Folder Include="Pages\" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
Loading…
Reference in new issue