Browse Source

Identity server host application is configured.

pull/570/head
Halil ibrahim Kalkan 8 years ago
parent
commit
fe45b3a6aa
  1. 1
      .gitignore
  2. 4
      templates/service/MyCompanyName.MyProjectName.sln
  3. 112
      templates/service/host/IdentityServerHost/IdentityServerDataSeeder.cs
  4. 24
      templates/service/host/IdentityServerHost/IdentityServerHostModule.cs
  5. 526
      templates/service/host/IdentityServerHost/Migrations/20181031075019_Initial.Designer.cs
  6. 447
      templates/service/host/IdentityServerHost/Migrations/20181031075019_Initial.cs
  7. 524
      templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs
  8. 4
      templates/service/host/IdentityServerHost/Pages/Index.cshtml
  9. 16
      templates/service/host/IdentityServerHost/Pages/Index.cshtml.cs
  10. 3
      templates/service/host/IdentityServerHost/appsettings.json
  11. 1
      templates/service/host/IdentityServerHost/tempkey.rsa

1
.gitignore

@ -278,3 +278,4 @@ templates/mvc/src/MyCompanyName.MyProjectName.Web/Logs/*.*
abp_io/src/Volo.AbpWebSite.Web/Logs/*
abp_io/src/Volo.AbpWebSite.Web/wwwroot/files/*
templates/service/host/MyCompanyName.MyProjectName.Host/Logs/logs.txt
templates/service/host/IdentityServerHost/Logs/logs.txt

4
templates/service/MyCompanyName.MyProjectName.sln

@ -37,9 +37,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Host", "host\MyCompanyName.MyProjectName.Host\MyCompanyName.MyProjectName.Host.csproj", "{E7353C9A-4357-4A40-A39A-52B73F5A0CA1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServerHost", "host\IdentityServerHost\IdentityServerHost.csproj", "{3F3E0DCA-DA28-42FA-ABC8-F49E5A920D68}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServerHost", "host\IdentityServerHost\IdentityServerHost.csproj", "{3F3E0DCA-DA28-42FA-ABC8-F49E5A920D68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleClient", "host\ConsoleClient\ConsoleClient.csproj", "{2A9E859C-BB5A-4A10-BB33-97ECBF10A8C8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleClient", "host\ConsoleClient\ConsoleClient.csproj", "{2A9E859C-BB5A-4A10-BB33-97ECBF10A8C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

112
templates/service/host/IdentityServerHost/IdentityServerDataSeeder.cs

@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.IdentityResources;
using Volo.Abp.Threading;
namespace IdentityServerHost
{
public class IdentityServerDataSeeder : ITransientDependency
{
private readonly IApiResourceRepository _apiResourceRepository;
private readonly IClientRepository _clientRepository;
private readonly IIdentityResourceRepository _identityResourceRepository;
public IdentityServerDataSeeder(
IClientRepository clientRepository,
IApiResourceRepository apiResourceRepository,
IIdentityResourceRepository identityResourceRepository)
{
_clientRepository = clientRepository;
_apiResourceRepository = apiResourceRepository;
_identityResourceRepository = identityResourceRepository;
}
public void Seed()
{
AsyncHelper.RunSync(SeedAsync);
}
private async Task SeedAsync()
{
if (await _clientRepository.FindByCliendIdAsync("test-client") != null)
{
return;
}
await SaveApiResource();
await SaveClientAsync();
await SaveIdentityResourcesAsync();
}
private async Task SaveApiResource()
{
var apiResource = new ApiResource(
Guid.NewGuid(),
"api1",
"My API",
"My api resource description"
);
apiResource.AddUserClaim("email");
apiResource.AddUserClaim("role");
await _apiResourceRepository.InsertAsync(apiResource);
}
private async Task SaveClientAsync()
{
var client = new Client(
Guid.NewGuid(),
"test-client"
)
{
ClientName = "test-client",
ProtocolType = "oidc",
Description = "test-client",
AlwaysIncludeUserClaimsInIdToken = true,
AllowOfflineAccess = true,
AbsoluteRefreshTokenLifetime = 31536000 //365 days
};
client.AddScope("api1");
client.AddScope("email");
client.AddScope("openid");
client.AddScope("profile");
client.AddScope("roles");
client.AddScope("unique_name");
client.AddGrantTypes(new List<string>
{
"client_credentials",
"password"
});
client.AddSecret("K7gNU3sdo+OL0wNhqoVWhr3g6s1xYv72ol/pe/Unols=");
await _clientRepository.InsertAsync(client);
}
private async Task SaveIdentityResourcesAsync()
{
var identityResourceOpenId = new IdentityResource(Guid.NewGuid(), "openid", "OpenID", required: true);
await _identityResourceRepository.InsertAsync(identityResourceOpenId);
var identityResourceEmail = new IdentityResource(Guid.NewGuid(), "email", "Email", required: true);
identityResourceEmail.AddUserClaim("email");
identityResourceEmail.AddUserClaim("email_verified");
await _identityResourceRepository.InsertAsync(identityResourceEmail);
var identityResourceRole = new IdentityResource(Guid.NewGuid(), "roles", "Roles", required: true);
identityResourceRole.AddUserClaim("role");
await _identityResourceRepository.InsertAsync(identityResourceRole);
var identityResourceProfile = new IdentityResource(Guid.NewGuid(), "profile", "Profile", required: true);
identityResourceProfile.AddUserClaim("unique_name");
await _identityResourceRepository.InsertAsync(identityResourceProfile);
}
}
}

24
templates/service/host/IdentityServerHost/IdentityServerHostModule.cs

@ -46,13 +46,12 @@ namespace IdentityServerHost
iis.AutomaticAuthentication = false;
});
//TODO: Configure distributed cache?
//context.Services.AddDistributedSqlServerCache(options =>
//{
// options.ConnectionString = configuration.GetConnectionString("Default");
// options.SchemaName = "dbo";
// options.TableName = "TestCache";
//});
context.Services.AddDistributedSqlServerCache(options =>
{
options.ConnectionString = configuration.GetConnectionString("SqlServerCache");
options.SchemaName = "dbo";
options.TableName = "TestCache";
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
@ -74,14 +73,9 @@ namespace IdentityServerHost
{
using (var scope = context.ServiceProvider.CreateScope())
{
var clientRepository = scope.ServiceProvider.GetRequiredService<IRepository<Client, Guid>>();
if (clientRepository.Any())
{
return;
}
var client = new Client(Guid.NewGuid(), "test-client");
clientRepository.Insert(client);
scope.ServiceProvider
.GetRequiredService<IdentityServerDataSeeder>()
.Seed();
}
}
}

526
templates/service/host/IdentityServerHost/Migrations/20181031075019_Initial.Designer.cs

@ -0,0 +1,526 @@
// <auto-generated />
using System;
using IdentityServerHost;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IdentityServerHost.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20181031075019_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.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
}
}
}

447
templates/service/host/IdentityServerHost/Migrations/20181031075019_Initial.cs

@ -0,0 +1,447 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace IdentityServerHost.Migrations
{
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "IdentityServerApiResources",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerClients",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
ClientName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
ClientUri = table.Column<string>(maxLength: 2000, nullable: true),
LogoUri = table.Column<string>(maxLength: 2000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
ProtocolType = table.Column<string>(maxLength: 200, nullable: false),
RequireClientSecret = table.Column<bool>(nullable: false),
RequireConsent = table.Column<bool>(nullable: false),
AllowRememberConsent = table.Column<bool>(nullable: false),
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false),
RequirePkce = table.Column<bool>(nullable: false),
AllowPlainTextPkce = table.Column<bool>(nullable: false),
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false),
FrontChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
BackChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
AllowOfflineAccess = table.Column<bool>(nullable: false),
IdentityTokenLifetime = table.Column<int>(nullable: false),
AccessTokenLifetime = table.Column<int>(nullable: false),
AuthorizationCodeLifetime = table.Column<int>(nullable: false),
ConsentLifetime = table.Column<int>(nullable: true),
AbsoluteRefreshTokenLifetime = table.Column<int>(nullable: false),
SlidingRefreshTokenLifetime = table.Column<int>(nullable: false),
RefreshTokenUsage = table.Column<int>(nullable: false),
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(nullable: false),
RefreshTokenExpiration = table.Column<int>(nullable: false),
AccessTokenType = table.Column<int>(nullable: false),
EnableLocalLogin = table.Column<bool>(nullable: false),
IncludeJwtId = table.Column<bool>(nullable: false),
AlwaysSendClientClaims = table.Column<bool>(nullable: false),
ClientClaimsPrefix = table.Column<string>(maxLength: 200, nullable: true),
PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClients", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResources",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
Required = table.Column<bool>(nullable: false),
Emphasize = 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
{
Id = table.Column<Guid>(nullable: false),
Key = table.Column<string>(maxLength: 200, nullable: false),
Type = table.Column<string>(maxLength: 50, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
Expiration = table.Column<DateTime>(nullable: true),
Data = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 196, nullable: false),
ApiResourceId = table.Column<Guid>(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),
DisplayName = table.Column<string>(maxLength: 128, nullable: true),
Description = table.Column<string>(maxLength: 256, nullable: true),
Required = table.Column<bool>(nullable: false),
Emphasize = 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
{
Expiration = table.Column<DateTime>(nullable: true),
Type = table.Column<string>(maxLength: 32, nullable: false),
Value = table.Column<string>(maxLength: 196, nullable: false),
Description = table.Column<string>(maxLength: 256, nullable: true),
ApiResourceId = table.Column<Guid>(nullable: false)
},
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
{
Expiration = table.Column<DateTime>(nullable: true),
Type = table.Column<string>(maxLength: 32, nullable: false),
Value = table.Column<string>(maxLength: 196, nullable: false),
Description = table.Column<string>(maxLength: 256, nullable: true),
ClientId = table.Column<Guid>(nullable: false)
},
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
{
Type = table.Column<string>(maxLength: 196, nullable: false),
IdentityResourceId = table.Column<Guid>(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
{
Type = table.Column<string>(maxLength: 196, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false),
Name = 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");
}
}
}

524
templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs

@ -0,0 +1,524 @@
// <auto-generated />
using System;
using IdentityServerHost;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IdentityServerHost.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
partial class DemoAppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.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
}
}
}

4
templates/service/host/IdentityServerHost/Pages/Index.cshtml

@ -0,0 +1,4 @@
@page
@model IdentityServerHost.Pages.IndexModel
<h3>Identity Server</h3>
<p>Identity Server is up and running...</p>

16
templates/service/host/IdentityServerHost/Pages/Index.cshtml.cs

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace IdentityServerHost.Pages
{
public class IndexModel : PageModel
{
public void OnGet()
{
}
}
}

3
templates/service/host/IdentityServerHost/appsettings.json

@ -1,5 +1,6 @@
{
"ConnectionStrings": {
"Default": "Server=localhost;Database=IdentityServerHost;Trusted_Connection=True;MultipleActiveResultSets=true"
"Default": "Server=localhost;Database=IdentityServerHost;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectNameCache;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}

1
templates/service/host/IdentityServerHost/tempkey.rsa

@ -0,0 +1 @@
{"KeyId":"0590816638b0f87bd230e19c32f7cec9","Parameters":{"D":"yIGe39uGuy/OUB5AurrPjG+bjZ9V+bt7m/yJjOd/1jtzq4rcxc8iz7ZLgXVkSyzjgbg6m1x/xMFoUGdwYHdauvcuM2ATuP4IMxJ4R3L0s5Xk6dqYaCyN+3LJ/1H6YlBz6e5NdljVwybjHJGxuJRSE1JhsoHx8f3S3ITvVVLKxknXyWcjIdtYo+x5qEnHyQd7/I0M2q7JkRP8e2pPfQsCNbUYmjWmv/Kr3hI0Jyn2x8QpcoOBwe0gX3tq0V771x6A+zqQYMaU8zltdvzjHBCeqkBJBgYTh/jKBcWDfcmk2yxHg000sCQ5lSMTS5gt5kYsv482S+TrsSu9pCuQ2Nw6BQ==","DP":"iLJNtCSxG77N6xWGbjaJCr99evuPs6SOtUSx/RR7zHQKITSuTq127kpESoaK9FbZyQMSGqj20FX72OdUqlJO/aSaUZA9yBKhpv2+hHpc3wsBaSbv+DadcWpe3c6MnadlV/WhRMWqGRNOr5iAroCbuDR3xR3isIEqZxnf86xla88=","DQ":"jkOQUtr0PSAtRexVQpu4bTVgJP2pfNK90o3NzG7rFscWJb94uBZC22clCUlmRJ+fFTkL4iO7rD7Uz0AYKLOtrw+WOvpEv4MBg7x/sWWblbbJr7alt7XwWoi2CT0R+pBS7VuQE+XhTUxFM+SQDWDMIpdGQ4/MBk9OXLZL99kipLc=","Exponent":"AQAB","InverseQ":"VSPcFjYbRq1lLOV8LfZnF2wdomOMH4uX2Va2b1Z0MCr+gDBx28EJNpUl2EGLY58ejA7dS0uapx0TyDehEM3ShS4cHFMnf8OoUB52EEgsF9msIDX5xvqJ+Bkt9mYiY7CWbXFCI4PZT94j/XdepO6JSr1/P6ZH3ncRRH2IJ6pPjDo=","Modulus":"z1wM2it4NloyS0MO9oZo/SP5N+BwsiP/yay3MsFJXz2/GBUznjTdtdwZnFga27VCmuOjeRYjWjtESlh/M6eTY8ztPOIr1ci7zVpYZ48Iy+9HE9poVy5ATdLuS19nivUANSOdmHB7X1oKwGHJRW43xUwAx3qkpmLnSE5J8Zpemyyto9tkvHqZhOAfcP/Gw7KszOvKHS1FEmaE9JFrqFtD5ODglAwF14uTfa6I6Wy0ws49LMm7ul6YZ7Ey1Y9kQ50TuJ+Z7BK/OkjOnTIuM0JsqwSMZ99Nq5po3ERo0iBxAZaYvO4SRjRxwL/tr7KLBtCp/4cEFRXRYz5k/hzGGfbDBQ==","P":"1ntEkTjBbqhZDYw1femyxVfV2RZq8fwUYkFwunUtuLgnZ420U/1ctgl9vX5oBqFdGp+OO5q7+5eQWSis2LBTWneGyF74W+/OPi472CrQFhzL7F1vwZL55uHnCCEpApFvC+PWwTCs4KvariSXbYzy4gZDfUq9x3QU6eHgZXkVhR8=","Q":"93/Z4QwtsdbEO5F4M5l10q9g43M12+qgDAoWUZEM7huxHxZvipBRxuOeEEkQaWZ02cL3/vbmOU35Vz4FKBKw1B2HecZwUUZO6p01FJDWDyulAl+70IlhwlDpyNqSJTcWz5kDszHoqHZDBSSKPL7cMH1tRf02AYgBqIRUf5pob1s="}}
Loading…
Cancel
Save