question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AddAdminAspNetIdentityServices and DbContexts from IdentityServer4

See original GitHub issue

Hi 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
skorubacommented, Nov 10, 2018

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!

0reactions
skorubacommented, Apr 4, 2019

Done on master. Please check new release. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

IdentityServer4 and Asp.Net Core Identity
This AddDbContexts helper method is used for registration of DbContexts for whole administration. The solution uses these DbContexts : AdminIdentityDbContext : ...
Read more >
Using with existing ASP.NET Identity deployment
How to configure Asp.Net Core Identity - database, primary key data type¶ ; You can setup the DbContext - in Startup.cs : ;...
Read more >
Skoruba IdentityServer4 Admin Documentation
Entities for the Asp.Net Core Identity. Skoruba.IdentityServer4.Admin.EntityFramework.DbContexts project that contains AdminDb-.
Read more >
using IdentityServer4 with custom Configration DBContext
Is this the right way to use a custom dbcontext with IDS4? and How do I fix this issue, and complete my migration...
Read more >
How to Migrate the IdentityServer4 Configuration ...
In this article we are going to learn how to Migrate the IdentityServer4 Configuration to the MS SQL database in a few easy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found