Update Consent.

pull/4578/head
maliming 5 years ago
parent 19279e8c84
commit b8719fbc15

@ -1,5 +1,4 @@
@page
@using IdentityServer4.Extensions
@using Volo.Abp.Account.Web.Pages
@model ConsentModel
<abp-card id="IdentityServerConsentWrapper">
@ -31,28 +30,29 @@
<ul class="list-group">
@foreach (var identityScope in Model.Consent.IdentityScopes)
@for (var i = 0; i < Model.Consent.IdentityScopes.Count; i++)
{
<li class="list-group-item">
<div class="form-check">
<label asp-for="@identityScope.Checked" class="form-check-label">
<input asp-for="@identityScope.Checked" class="form-check-input"/>
@identityScope.DisplayName
@if (identityScope.Required)
<label asp-for="@Model.Consent.IdentityScopes[i].Checked" class="form-check-label">
<input asp-for="@Model.Consent.IdentityScopes[i].Checked" class="form-check-input" />
@Model.Consent.IdentityScopes[i].DisplayName
@if (Model.Consent.IdentityScopes[i].Required)
{
<span><em>(required)</em></span>
}
</label>
</div>
<input asp-for="@identityScope.Value" type="hidden"/> @* TODO: Use attributes on the view model instead of using hidden here *@
@if (identityScope.Description != null)
<input asp-for="@Model.Consent.IdentityScopes[i].Value" type="hidden" /> @* TODO: Use attributes on the view model instead of using hidden here *@
@if (Model.Consent.IdentityScopes[i].Description != null)
{
<div class="consent-description">
@identityScope.Description
@Model.Consent.IdentityScopes[i].Description
</div>
}
</li>
}
</ul>
}
@ -62,24 +62,24 @@
<ul class="list-group">
@foreach (var apiScope in Model.Consent.ApiScopes)
@for (var i = 0; i < Model.Consent.ApiScopes.Count; i++)
{
<li class="list-group-item">
<div class="form-check">
<label asp-for="@apiScope.Checked" class="form-check-label">
<input asp-for="@apiScope.Checked" class="form-check-input" disabled="@apiScope.Required"/>
@apiScope.DisplayName
@if (apiScope.Required)
<label asp-for="@Model.Consent.ApiScopes[i].Checked" class="form-check-label">
<input asp-for="@Model.Consent.ApiScopes[i].Checked" class="form-check-input" disabled="@Model.Consent.ApiScopes[i].Required" />
@Model.Consent.ApiScopes[i].DisplayName
@if (Model.Consent.ApiScopes[i].Required)
{
<span><em>(required)</em></span>
}
</label>
</div>
<input asp-for="@apiScope.Value" type="hidden"/> @* TODO: Use attributes on the view model instead of using hidden here *@
@if (apiScope.Description != null)
<input asp-for="@Model.Consent.ApiScopes[i].Value" type="hidden" /> @* TODO: Use attributes on the view model instead of using hidden here *@
@if (Model.Consent.ApiScopes[i].Description != null)
{
<div class="consent-description">
@apiScope.Description
@Model.Consent.ApiScopes[i].Description
</div>
}
</li>
@ -110,8 +110,8 @@
}
<div>
<button name="UserDecision" value="yes" class="btn btn-primary" autofocus>Yes, Allow</button>
<button name="UserDecision" value="no" class="btn">No, Do Not Allow</button>
<button name="Consent.Button" value="yes" class="btn btn-primary" autofocus>Yes, Allow</button>
<button name="Consent.Button" value="no" class="btn">No, Do Not Allow</button>
@if (Model.Consent.ClientUrl != null)
{
<a class="pull-right btn btn-secondary" target="_blank" href="@Model.Consent.ClientUrl">

@ -88,13 +88,15 @@ namespace Volo.Abp.Account.Web.Pages
// user clicked 'yes' - validate the data
else if (Consent?.Button == "yes")
{
Consent.ScopesConsented =
Consent.ApiScopes.Union(Consent.IdentityScopes).Distinct().Select(x => x.Value).ToList();
// if the user consented to some scope, build the response model
if (!Consent.ScopesConsented.IsNullOrEmpty())
{
var scopes = Consent.ScopesConsented;
if (ConsentOptions.EnableOfflineAccess == false)
{
scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess);
scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess).ToList();
}
grantedConsent = new ConsentResponse
@ -124,7 +126,7 @@ namespace Volo.Abp.Account.Web.Pages
await _interaction.GrantConsentAsync(request, grantedConsent);
// indicate that's it ok to redirect back to authorization endpoint
result.RedirectUri = Consent.ReturnUrl; //TODO: ReturnUrlHash?
result.RedirectUri = ReturnUrl; //TODO: ReturnUrlHash?
result.Client = request.Client;
}
else
@ -153,11 +155,9 @@ namespace Volo.Abp.Account.Web.Pages
var consentViewModel = new ConsentViewModel
{
RememberConsent = model?.RememberConsent ?? true,
ScopesConsented = model?.ScopesConsented ?? Enumerable.Empty<string>(),
ScopesConsented = model?.ScopesConsented ?? new List<string>(),
Description = model?.Description,
ReturnUrl = returnUrl,
ClientName = request.Client.ClientName ?? request.Client.ClientId,
ClientUrl = request.Client.ClientUri,
ClientLogoUrl = request.Client.LogoUri,
@ -166,7 +166,7 @@ namespace Volo.Abp.Account.Web.Pages
consentViewModel.IdentityScopes = request.ValidatedResources.Resources.IdentityResources.Select(x =>
CreateScopeViewModel(x, consentViewModel.ScopesConsented.Contains(x.Name) || model == null))
.ToArray();
.ToList();
var apiScopes = new List<ScopeViewModel>();
foreach(var parsedScope in request.ValidatedResources.ParsedScopes)
@ -240,10 +240,9 @@ namespace Volo.Abp.Account.Web.Pages
[Required]
public string Button { get; set; }
public IEnumerable<string> ScopesConsented { get; set; }
public bool RememberConsent { get; set; }
public List<string> ScopesConsented { get; set; }
public string ReturnUrl { get; set; }
public bool RememberConsent { get; set; }
public string Description { get; set; }
}
@ -258,9 +257,9 @@ namespace Volo.Abp.Account.Web.Pages
public bool AllowRememberConsent { get; set; }
public IEnumerable<ScopeViewModel> IdentityScopes { get; set; }
public List<ScopeViewModel> IdentityScopes { get; set; }
public IEnumerable<ScopeViewModel> ApiScopes { get; set; }
public List<ScopeViewModel> ApiScopes { get; set; }
}
public class ScopeViewModel

@ -25,8 +25,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="IdentityServer4" Version="4.0.1" />
<PackageReference Include="IdentityServer4.AspNetIdentity" Version="4.0.1" />
<PackageReference Include="IdentityServer4" Version="4.0.2" />
<PackageReference Include="IdentityServer4.AspNetIdentity" Version="4.0.2" />
</ItemGroup>
</Project>

@ -32,7 +32,8 @@ namespace Volo.Abp.IdentityServer.ApiScopes
}
protected internal ApiScope(
public ApiScope(
Guid id,
[NotNull] string name,
string displayName = null,
string description = null,
@ -43,6 +44,7 @@ namespace Volo.Abp.IdentityServer.ApiScopes
{
Check.NotNull(name, nameof(name));
Id = id;
Name = name;
DisplayName = displayName ?? name;
Description = description;

@ -7,6 +7,12 @@ namespace Volo.Abp.IdentityServer.ApiScopes
{
public interface IApiScopeRepository : IBasicRepository<ApiScope>
{
Task<ApiScope> GetByNameAsync(
string scopeName,
bool includeDetails = true,
CancellationToken cancellationToken = default
);
Task<List<ApiScope>> GetListByNameAsync(
string[] scopeNames,
bool includeDetails = false,

@ -16,6 +16,11 @@ namespace Volo.Abp.IdentityServer.ApiScopes
{
}
public async Task<ApiScope> GetByNameAsync(string scopeName, bool includeDetails = true, CancellationToken cancellationToken = default)
{
return await DbSet.FirstOrDefaultAsync(x => x.Name == scopeName, GetCancellationToken(cancellationToken));
}
public async Task<List<ApiScope>> GetListByNameAsync(string[] scopeNames, bool includeDetails = false,
CancellationToken cancellationToken = default)
{

@ -19,6 +19,11 @@ namespace Volo.Abp.IdentityServer.MongoDB
{
}
public async Task<ApiScope> GetByNameAsync(string scopeName, bool includeDetails = true, CancellationToken cancellationToken = default)
{
return await GetMongoQueryable().FirstOrDefaultAsync(x => x.Name == scopeName, GetCancellationToken(cancellationToken));
}
public async Task<List<ApiScope>> GetListByNameAsync(string[] scopeNames, bool includeDetails = false,
CancellationToken cancellationToken = default)
{

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using IdentityServer4.Models;
@ -13,6 +13,7 @@ using Volo.Abp.IdentityServer.IdentityResources;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Uow;
using ApiResource = Volo.Abp.IdentityServer.ApiScopes.ApiResource;
using ApiScope = Volo.Abp.IdentityServer.ApiScopes.ApiScope;
using Client = Volo.Abp.IdentityServer.Clients.Client;
namespace MyCompanyName.MyProjectName.IdentityServer
@ -20,6 +21,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer
public class IdentityServerDataSeedContributor : IDataSeedContributor, ITransientDependency
{
private readonly IApiResourceRepository _apiResourceRepository;
private readonly IApiScopeRepository _apiScopeRepository;
private readonly IClientRepository _clientRepository;
private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder;
private readonly IGuidGenerator _guidGenerator;
@ -29,6 +31,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer
public IdentityServerDataSeedContributor(
IClientRepository clientRepository,
IApiResourceRepository apiResourceRepository,
IApiScopeRepository apiScopeRepository,
IIdentityResourceDataSeeder identityResourceDataSeeder,
IGuidGenerator guidGenerator,
IPermissionDataSeeder permissionDataSeeder,
@ -36,6 +39,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer
{
_clientRepository = clientRepository;
_apiResourceRepository = apiResourceRepository;
_apiScopeRepository = apiScopeRepository;
_identityResourceDataSeeder = identityResourceDataSeeder;
_guidGenerator = guidGenerator;
_permissionDataSeeder = permissionDataSeeder;
@ -47,6 +51,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer
{
await _identityResourceDataSeeder.CreateStandardResourcesAsync();
await CreateApiResourcesAsync();
await CreateApiScopeAsync();
await CreateClientsAsync();
}
@ -91,6 +96,15 @@ namespace MyCompanyName.MyProjectName.IdentityServer
return await _apiResourceRepository.UpdateAsync(apiResource);
}
private async Task CreateApiScopeAsync()
{
var apiScope = await _apiScopeRepository.GetByNameAsync("MyProjectName");
if (apiScope == null)
{
await _apiScopeRepository.InsertAsync(new ApiScope(_guidGenerator.Create(), "MyProjectName", "MyProjectName API"), autoSave: true);
}
}
private async Task CreateClientsAsync()
{
var commonScopes = new[]
@ -101,6 +115,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer
"role",
"phone",
"address",
"MyProjectName"
};
@ -168,6 +183,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer
AuthorizationCodeLifetime = 300,
IdentityTokenLifetime = 300,
RequireConsent = false,
RequirePkce = false,
FrontChannelLogoutUri = frontChannelLogoutUri
},
autoSave: true

@ -11,7 +11,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations
{
[DbContext(typeof(MyProjectNameMigrationsDbContext))]
[Migration("20200624023152_Initial")]
[Migration("20200706091528_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -863,12 +863,15 @@ namespace MyCompanyName.MyProjectName.Migrations
b.ToTable("AbpOrganizationUnitRoles");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResource", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("AllowedAccessTokenSigningAlgorithms")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
@ -928,12 +931,15 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("ShowInDiscoveryDocument")
.HasColumnType("bit");
b.HasKey("Id");
b.ToTable("IdentityServerApiResources");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceClaim", b =>
{
b.Property<Guid>("ApiResourceId")
.HasColumnType("uniqueidentifier");
@ -944,18 +950,76 @@ namespace MyCompanyName.MyProjectName.Migrations
b.HasKey("ApiResourceId", "Type");
b.ToTable("IdentityServerApiClaims");
b.ToTable("IdentityServerApiResourceClaims");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceScope", b =>
{
b.Property<Guid>("ApiResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
b.Property<string>("Scope")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.HasKey("ApiResourceId", "Scope");
b.ToTable("IdentityServerApiResourceScopes");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceSecret", b =>
{
b.Property<Guid>("ApiResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Type")
.HasColumnType("nvarchar(250)")
.HasMaxLength(250);
b.Property<string>("Value")
.HasColumnType("nvarchar(4000)")
.HasMaxLength(4000);
b.Property<string>("Description")
.HasColumnType("nvarchar(2000)")
.HasMaxLength(2000);
b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.HasKey("ApiResourceId", "Type", "Value");
b.ToTable("IdentityServerApiResourceSecrets");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(1000)")
.HasMaxLength(1000);
@ -967,20 +1031,49 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<bool>("Emphasize")
.HasColumnType("bit");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<bool>("ShowInDiscoveryDocument")
.HasColumnType("bit");
b.HasKey("ApiResourceId", "Name");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("IdentityServerApiScopes");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b =>
{
b.Property<Guid>("ApiResourceId")
b.Property<Guid>("ApiScopeId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
@ -991,34 +1084,28 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.HasKey("ApiResourceId", "Name", "Type");
b.HasKey("ApiScopeId", "Name", "Type");
b.ToTable("IdentityServerApiScopeClaims");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b =>
{
b.Property<Guid>("ApiResourceId")
b.Property<Guid>("ApiScopeId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Type")
b.Property<string>("Key")
.HasColumnType("nvarchar(250)")
.HasMaxLength(250);
b.Property<string>("Value")
.HasColumnType("nvarchar(4000)")
.HasMaxLength(4000);
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(2000)")
.HasMaxLength(2000);
b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.HasKey("ApiResourceId", "Type", "Value");
b.HasKey("ApiScopeId", "Key");
b.ToTable("IdentityServerApiSecrets");
b.ToTable("IdentityServerApiScopeProperties");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b =>
@ -1048,6 +1135,9 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<bool>("AllowRememberConsent")
.HasColumnType("bit");
b.Property<string>("AllowedIdentityTokenSigningAlgorithms")
.HasColumnType("nvarchar(max)");
b.Property<bool>("AlwaysIncludeUserClaimsInIdToken")
.HasColumnType("bit");
@ -1178,6 +1268,9 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<bool>("RequirePkce")
.HasColumnType("bit");
b.Property<bool>("RequireRequestObject")
.HasColumnType("bit");
b.Property<int>("SlidingRefreshTokenLifetime")
.HasColumnType("int");
@ -1374,6 +1467,9 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(max)")
.HasMaxLength(50000);
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceCode")
.IsRequired()
.HasColumnType("nvarchar(200)")
@ -1387,6 +1483,9 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<string>("SessionId")
.HasColumnType("nvarchar(max)");
b.Property<string>("SubjectId")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
@ -1426,6 +1525,9 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<DateTime?>("ConsumedTime")
.HasColumnType("datetime2");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
@ -1434,6 +1536,9 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(max)")
.HasMaxLength(50000);
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
@ -1444,6 +1549,9 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("SessionId")
.HasColumnType("nvarchar(max)");
b.Property<string>("SubjectId")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
@ -1462,20 +1570,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.ToTable("IdentityServerPersistedGrants");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b =>
{
b.Property<Guid>("IdentityResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Type")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.HasKey("IdentityResourceId", "Type");
b.ToTable("IdentityServerIdentityClaims");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b =>
{
b.Property<Guid>("Id")
@ -1541,9 +1635,6 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Required")
.HasColumnType("bit");
@ -1552,9 +1643,45 @@ namespace MyCompanyName.MyProjectName.Migrations
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("IdentityServerIdentityResources");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b =>
{
b.Property<Guid>("IdentityResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Type")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.HasKey("IdentityResourceId", "Type");
b.ToTable("IdentityServerIdentityResourceClaims");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b =>
{
b.Property<Guid>("IdentityResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Key")
.HasColumnType("nvarchar(250)")
.HasMaxLength(250);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(2000)")
.HasMaxLength(2000);
b.HasKey("IdentityResourceId", "Key");
b.ToTable("IdentityServerIdentityResourceProperties");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
@ -1810,38 +1937,47 @@ namespace MyCompanyName.MyProjectName.Migrations
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceClaim", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null)
.WithMany("UserClaims")
.HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceScope", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null)
.WithMany("Scopes")
.HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceSecret", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null)
.WithMany("Secrets")
.HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null)
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null)
.WithMany("UserClaims")
.HasForeignKey("ApiResourceId", "Name")
.HasForeignKey("ApiScopeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
.WithMany("Secrets")
.HasForeignKey("ApiResourceId")
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null)
.WithMany("Properties")
.HasForeignKey("ApiScopeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
@ -1927,7 +2063,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b =>
{
b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null)
.WithMany("UserClaims")
@ -1936,6 +2072,15 @@ namespace MyCompanyName.MyProjectName.Migrations
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b =>
{
b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null)
.WithMany("Properties")
.HasForeignKey("IdentityResourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)

@ -249,6 +249,8 @@ namespace MyCompanyName.MyProjectName.Migrations
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
AllowedAccessTokenSigningAlgorithms = table.Column<string>(nullable: true),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false),
Properties = table.Column<string>(nullable: true)
},
constraints: table =>
@ -256,6 +258,33 @@ namespace MyCompanyName.MyProjectName.Migrations
table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopes",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
Enabled = table.Column<bool>(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),
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 => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerClients",
columns: table => new
@ -283,6 +312,7 @@ namespace MyCompanyName.MyProjectName.Migrations
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false),
RequirePkce = table.Column<bool>(nullable: false),
AllowPlainTextPkce = table.Column<bool>(nullable: false),
RequireRequestObject = 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),
@ -290,6 +320,7 @@ namespace MyCompanyName.MyProjectName.Migrations
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
AllowOfflineAccess = table.Column<bool>(nullable: false),
IdentityTokenLifetime = table.Column<int>(nullable: false),
AllowedIdentityTokenSigningAlgorithms = table.Column<string>(nullable: true),
AccessTokenLifetime = table.Column<int>(nullable: false),
AuthorizationCodeLifetime = table.Column<int>(nullable: false),
ConsentLifetime = table.Column<int>(nullable: true),
@ -325,7 +356,9 @@ namespace MyCompanyName.MyProjectName.Migrations
DeviceCode = table.Column<string>(maxLength: 200, nullable: false),
UserCode = table.Column<string>(maxLength: 200, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
SessionId = table.Column<string>(nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
Description = table.Column<string>(nullable: true),
Expiration = table.Column<DateTime>(nullable: false),
Data = table.Column<string>(maxLength: 50000, nullable: false)
},
@ -354,8 +387,7 @@ namespace MyCompanyName.MyProjectName.Migrations
Enabled = table.Column<bool>(nullable: false),
Required = table.Column<bool>(nullable: false),
Emphasize = table.Column<bool>(nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false),
Properties = table.Column<string>(nullable: true)
ShowInDiscoveryDocument = table.Column<bool>(nullable: false)
},
constraints: table =>
{
@ -372,9 +404,12 @@ namespace MyCompanyName.MyProjectName.Migrations
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
Type = table.Column<string>(maxLength: 50, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
SessionId = table.Column<string>(nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
Description = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
Expiration = table.Column<DateTime>(nullable: true),
ConsumedTime = table.Column<DateTime>(nullable: true),
Data = table.Column<string>(maxLength: 50000, nullable: false)
},
constraints: table =>
@ -615,7 +650,7 @@ namespace MyCompanyName.MyProjectName.Migrations
});
migrationBuilder.CreateTable(
name: "IdentityServerApiClaims",
name: "IdentityServerApiResourceClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
@ -623,9 +658,9 @@ namespace MyCompanyName.MyProjectName.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type });
table.PrimaryKey("PK_IdentityServerApiResourceClaims", x => new { x.ApiResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId",
name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
@ -633,22 +668,17 @@ namespace MyCompanyName.MyProjectName.Migrations
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopes",
name: "IdentityServerApiResourceScopes",
columns: table => new
{
ApiResourceId = 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),
Required = table.Column<bool>(nullable: false),
Emphasize = table.Column<bool>(nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false)
Scope = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name });
table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope });
table.ForeignKey(
name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId",
name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
@ -656,7 +686,7 @@ namespace MyCompanyName.MyProjectName.Migrations
});
migrationBuilder.CreateTable(
name: "IdentityServerApiSecrets",
name: "IdentityServerApiResourceSecrets",
columns: table => new
{
Type = table.Column<string>(maxLength: 250, nullable: false),
@ -667,15 +697,53 @@ namespace MyCompanyName.MyProjectName.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value });
table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId",
name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
ApiScopeId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiScopeId, x.Name, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScopeId",
column: x => x.ApiScopeId,
principalTable: "IdentityServerApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeProperties",
columns: table => new
{
ApiScopeId = 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_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key });
table.ForeignKey(
name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_ApiScopeId",
column: x => x.ApiScopeId,
principalTable: "IdentityServerApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientClaims",
columns: table => new
@ -844,7 +912,7 @@ namespace MyCompanyName.MyProjectName.Migrations
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityClaims",
name: "IdentityServerIdentityResourceClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
@ -852,9 +920,28 @@ namespace MyCompanyName.MyProjectName.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type });
table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId",
name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityResources_IdentityResourceId",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResourceProperties",
columns: table => new
{
IdentityResourceId = 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_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key });
table.ForeignKey(
name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdentityResources_IdentityResourceId",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
@ -884,25 +971,6 @@ namespace MyCompanyName.MyProjectName.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 200, 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_AbpAuditLogActions_AuditLogId",
table: "AbpAuditLogActions",
@ -1028,6 +1096,12 @@ namespace MyCompanyName.MyProjectName.Migrations
table: "AbpUsers",
column: "UserName");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerApiScopes_Name",
table: "IdentityServerApiScopes",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClients_ClientId",
table: "IdentityServerClients",
@ -1050,6 +1124,12 @@ namespace MyCompanyName.MyProjectName.Migrations
column: "UserCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_IdentityServerIdentityResources_Name",
table: "IdentityServerIdentityResources",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_Expiration",
table: "IdentityServerPersistedGrants",
@ -1109,13 +1189,19 @@ namespace MyCompanyName.MyProjectName.Migrations
name: "AbpUserTokens");
migrationBuilder.DropTable(
name: "IdentityServerApiClaims");
name: "IdentityServerApiResourceClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceScopes");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceSecrets");
migrationBuilder.DropTable(
name: "IdentityServerApiScopeClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiSecrets");
name: "IdentityServerApiScopeProperties");
migrationBuilder.DropTable(
name: "IdentityServerClientClaims");
@ -1148,7 +1234,10 @@ namespace MyCompanyName.MyProjectName.Migrations
name: "IdentityServerDeviceFlowCodes");
migrationBuilder.DropTable(
name: "IdentityServerIdentityClaims");
name: "IdentityServerIdentityResourceClaims");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResourceProperties");
migrationBuilder.DropTable(
name: "IdentityServerPersistedGrants");
@ -1168,6 +1257,9 @@ namespace MyCompanyName.MyProjectName.Migrations
migrationBuilder.DropTable(
name: "AbpUsers");
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
migrationBuilder.DropTable(
name: "IdentityServerApiScopes");
@ -1179,9 +1271,6 @@ namespace MyCompanyName.MyProjectName.Migrations
migrationBuilder.DropTable(
name: "AbpAuditLogs");
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
}
}
}

@ -861,12 +861,15 @@ namespace MyCompanyName.MyProjectName.Migrations
b.ToTable("AbpOrganizationUnitRoles");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResource", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("AllowedAccessTokenSigningAlgorithms")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
@ -926,12 +929,15 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("ShowInDiscoveryDocument")
.HasColumnType("bit");
b.HasKey("Id");
b.ToTable("IdentityServerApiResources");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceClaim", b =>
{
b.Property<Guid>("ApiResourceId")
.HasColumnType("uniqueidentifier");
@ -942,18 +948,76 @@ namespace MyCompanyName.MyProjectName.Migrations
b.HasKey("ApiResourceId", "Type");
b.ToTable("IdentityServerApiClaims");
b.ToTable("IdentityServerApiResourceClaims");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceScope", b =>
{
b.Property<Guid>("ApiResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
b.Property<string>("Scope")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.HasKey("ApiResourceId", "Scope");
b.ToTable("IdentityServerApiResourceScopes");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceSecret", b =>
{
b.Property<Guid>("ApiResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Type")
.HasColumnType("nvarchar(250)")
.HasMaxLength(250);
b.Property<string>("Value")
.HasColumnType("nvarchar(4000)")
.HasMaxLength(4000);
b.Property<string>("Description")
.HasColumnType("nvarchar(2000)")
.HasMaxLength(2000);
b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.HasKey("ApiResourceId", "Type", "Value");
b.ToTable("IdentityServerApiResourceSecrets");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(1000)")
.HasMaxLength(1000);
@ -965,20 +1029,49 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<bool>("Emphasize")
.HasColumnType("bit");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<bool>("ShowInDiscoveryDocument")
.HasColumnType("bit");
b.HasKey("ApiResourceId", "Name");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("IdentityServerApiScopes");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b =>
{
b.Property<Guid>("ApiResourceId")
b.Property<Guid>("ApiScopeId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
@ -989,34 +1082,28 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.HasKey("ApiResourceId", "Name", "Type");
b.HasKey("ApiScopeId", "Name", "Type");
b.ToTable("IdentityServerApiScopeClaims");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b =>
{
b.Property<Guid>("ApiResourceId")
b.Property<Guid>("ApiScopeId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Type")
b.Property<string>("Key")
.HasColumnType("nvarchar(250)")
.HasMaxLength(250);
b.Property<string>("Value")
.HasColumnType("nvarchar(4000)")
.HasMaxLength(4000);
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(2000)")
.HasMaxLength(2000);
b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.HasKey("ApiResourceId", "Type", "Value");
b.HasKey("ApiScopeId", "Key");
b.ToTable("IdentityServerApiSecrets");
b.ToTable("IdentityServerApiScopeProperties");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b =>
@ -1046,6 +1133,9 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<bool>("AllowRememberConsent")
.HasColumnType("bit");
b.Property<string>("AllowedIdentityTokenSigningAlgorithms")
.HasColumnType("nvarchar(max)");
b.Property<bool>("AlwaysIncludeUserClaimsInIdToken")
.HasColumnType("bit");
@ -1176,6 +1266,9 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<bool>("RequirePkce")
.HasColumnType("bit");
b.Property<bool>("RequireRequestObject")
.HasColumnType("bit");
b.Property<int>("SlidingRefreshTokenLifetime")
.HasColumnType("int");
@ -1372,6 +1465,9 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(max)")
.HasMaxLength(50000);
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceCode")
.IsRequired()
.HasColumnType("nvarchar(200)")
@ -1385,6 +1481,9 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<string>("SessionId")
.HasColumnType("nvarchar(max)");
b.Property<string>("SubjectId")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
@ -1424,6 +1523,9 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<DateTime?>("ConsumedTime")
.HasColumnType("datetime2");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
@ -1432,6 +1534,9 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(max)")
.HasMaxLength(50000);
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
@ -1442,6 +1547,9 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("SessionId")
.HasColumnType("nvarchar(max)");
b.Property<string>("SubjectId")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
@ -1460,20 +1568,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.ToTable("IdentityServerPersistedGrants");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b =>
{
b.Property<Guid>("IdentityResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Type")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.HasKey("IdentityResourceId", "Type");
b.ToTable("IdentityServerIdentityClaims");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b =>
{
b.Property<Guid>("Id")
@ -1539,9 +1633,6 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Required")
.HasColumnType("bit");
@ -1550,9 +1641,45 @@ namespace MyCompanyName.MyProjectName.Migrations
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("IdentityServerIdentityResources");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b =>
{
b.Property<Guid>("IdentityResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Type")
.HasColumnType("nvarchar(200)")
.HasMaxLength(200);
b.HasKey("IdentityResourceId", "Type");
b.ToTable("IdentityServerIdentityResourceClaims");
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b =>
{
b.Property<Guid>("IdentityResourceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Key")
.HasColumnType("nvarchar(250)")
.HasMaxLength(250);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(2000)")
.HasMaxLength(2000);
b.HasKey("IdentityResourceId", "Key");
b.ToTable("IdentityServerIdentityResourceProperties");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
@ -1808,38 +1935,47 @@ namespace MyCompanyName.MyProjectName.Migrations
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceClaim", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null)
.WithMany("UserClaims")
.HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceScope", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null)
.WithMany("Scopes")
.HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceSecret", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null)
.WithMany("Secrets")
.HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null)
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null)
.WithMany("UserClaims")
.HasForeignKey("ApiResourceId", "Name")
.HasForeignKey("ApiScopeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b =>
{
b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
.WithMany("Secrets")
.HasForeignKey("ApiResourceId")
b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null)
.WithMany("Properties")
.HasForeignKey("ApiScopeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
@ -1925,7 +2061,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b =>
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b =>
{
b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null)
.WithMany("UserClaims")
@ -1934,6 +2070,15 @@ namespace MyCompanyName.MyProjectName.Migrations
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b =>
{
b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null)
.WithMany("Properties")
.HasForeignKey("IdentityResourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)

@ -84,6 +84,7 @@ namespace MyCompanyName.MyProjectName
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiBasicThemeModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAccountWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}account{0}src{0}Volo.Abp.Account.Web", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAccountWebIdentityServerModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}account{0}src{0}Volo.Abp.Account.Web.IdentityServer", Path.DirectorySeparatorChar)));
//</TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain.Shared"));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain"));
@ -157,7 +158,7 @@ namespace MyCompanyName.MyProjectName
{
app.UseMultiTenancy();
}
app.UseAbpRequestLocalization();
app.UseIdentityServer();
app.UseAuthorization();

Loading…
Cancel
Save