Browse Source

PersistedGrantStore should not set protected Entity.Id

pull/1810/head
Halil İbrahim Kalkan 6 years ago
parent
commit
72847a3277
  1. 3
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrantStore.cs
  2. 3
      modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs

3
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrantStore.cs

@ -2,6 +2,7 @@
using System.Linq;
using System.Threading.Tasks;
using IdentityServer4.Stores;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping;
@ -26,7 +27,7 @@ namespace Volo.Abp.IdentityServer.Grants
if (entity == null)
{
entity = _objectMapper.Map<IdentityServer4.Models.PersistedGrant, PersistedGrant>(grant);
entity.Id = _guidGenerator.Create();
EntityHelper.TrySetId(entity, () => _guidGenerator.Create());
await _persistentGrantRepository.InsertAsync(entity);
}
else

3
modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs

@ -140,7 +140,8 @@ namespace Volo.Abp.IdentityServer.Clients
{
Key = "#1P3R",
Type = "Type",
ClientId = "ClientId"
ClientId = "ClientId",
Data = ""
});
//Act

Loading…
Cancel
Save