Duende.IdentityServer.Admin icon indicating copy to clipboard operation
Duende.IdentityServer.Admin copied to clipboard

Incorrect id return after post properties to client in Admin API

Open gekiss opened this issue 1 year ago • 2 comments

Describe the bug

Adding client property through admin API, POST api/Clients/{id}/Properties

https://github.com/skoruba/Duende.IdentityServer.Admin/blob/724a318e80f710d13a457088887b94ace24e7dec/src/Skoruba.Duende.IdentityServer.Admin.Api/Controllers/ClientsController.cs#L174

expected that method return newly added property id, but method always return value id equal 1

To Reproduce

Create client POST api/Clients

then add property to existing client POST api/Clients/{id}/Properties

Explanation

IMHO the method AddClientPropertyAsync must be return clientProperty.Id instead of function AutoSaveChangesAsync result https://github.com/skoruba/Duende.IdentityServer.Admin/blob/724a318e80f710d13a457088887b94ace24e7dec/src/Skoruba.Duende.IdentityServer.Admin.EntityFramework/Repositories/ClientRepository.cs#L190

like the method AddClientAsync https://github.com/skoruba/Duende.IdentityServer.Admin/blob/724a318e80f710d13a457088887b94ace24e7dec/src/Skoruba.Duende.IdentityServer.Admin.EntityFramework/Repositories/ClientRepository.cs#L320

The same behavior when add claim to client

Thanks for your work.

gekiss avatar Mar 08 '23 14:03 gekiss