AddAdminAspNetIdentityServices and DbContexts from IdentityServer4
See original GitHub issueHi Skoruba,
I have PersistedGrantDbContext defined in IdentityServer4 project. I have extended the context with your IAdminPersistedGrantDbContext interface and current it looks like following:
public class PersistedGrantDbContext : IdentityServer4.EntityFramework.DbContexts.PersistedGrantDbContext<PersistedGrantDbContext>, IAdminPersistedGrantDbContext { public PersistedGrantDbContext(DbContextOptions options, OperationalStoreOptions storeOptions) : base(options, storeOptions) { } }
The problem is that I still cannot use the context in AddAdminAspNetIdentityServices: The PersistedGrantDbContext based on IdentityServer4.EntityFramework.DbContexts.PersistedGrantDbContext (witch is based on DbContext). The AddAdminAspNetIdentityServices extension metchod requires TPersistedGrantDbContext where TIdentityDbContext : IdentityDbContext<…> and this a problem. We cannot use context from IdentityServer (with already defined mappings, migrations, ect). I do not want to create another DbContext or to use your implementation of AdminDbContext.
It is possible to use IdentityService context (PersistedGrantDbContext) and register in AddAdminAspNetIdentityServices? What are the steps? Please help. I’d like to use your project in my infrastructures 😃
Cheers!
p.s. I’m using version 1.0.0-beta3 and latest IdentityServer stable packages IdentityServer4 (2.2.0) IdentityServer4.AspNetIdentity (2.1.0) IdentityServer4.EntityFramework (2.1.1)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
OK, I see your requirement, but currently is necessary to implement DbContext like you mentioned above, because some view which are bound with Identity and PersistedGrants. I will consider to create an alternative overload and remove this required inheritents. Thank you for your great feedback!
Done on
master
. Please check new release. Thanks!