Browse Source

ClientRepository changes

pull/570/head
Yunus Emre Kalkan 8 years ago
parent
commit
162b4112e6
  1. 5
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/Client.cs
  2. 7
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/Clients/ClientRepository.cs

5
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/Client.cs

@ -153,6 +153,11 @@ namespace Volo.Abp.IdentityServer.Clients
); );
} }
public virtual void RemoveAllAllowedGrantTypes()
{
AllowedGrantTypes.Clear();
}
public virtual void AddSecret([NotNull] string value, DateTime? expiration = null, string type = IdentityServerConstants.SecretTypes.SharedSecret, string description = null) public virtual void AddSecret([NotNull] string value, DateTime? expiration = null, string type = IdentityServerConstants.SecretTypes.SharedSecret, string description = null)
{ {
ClientSecrets.Add(new ClientSecret(Id, value, expiration, type, description)); ClientSecrets.Add(new ClientSecret(Id, value, expiration, type, description));

7
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/Clients/ClientRepository.cs

@ -59,6 +59,13 @@ namespace Volo.Abp.IdentityServer.Clients
DbContext.Set<ClientClaim>().Remove(claim); DbContext.Set<ClientClaim>().Remove(claim);
} }
var grantTypes = DbContext.Set<ClientGrantType>().Where(s => s.ClientId == entity.Id);
foreach (var grantType in grantTypes)
{
DbContext.Set<ClientGrantType>().Remove(grantType);
}
return await base.UpdateAsync(entity, autoSave, cancellationToken); return await base.UpdateAsync(entity, autoSave, cancellationToken);
} }

Loading…
Cancel
Save