IdentityServer4 PersistedGrantDbContext & ConfigurationDbContext

Viewed 6761

New to IdentityServer 4. I followed the IdentityServer4 EntityFramework sample here on the documentation.

After the migration script is run

dotnet ef migrations add InitialIdentityServerPersistedGrantDbMigration -c PersistedGrantDbContext -o Data/Migrations/IdentityServer/PersistedGrantDb
dotnet ef migrations add InitialIdentityServerConfigurationDbMigration -c ConfigurationDbContext -o Data/Migrations/IdentityServer/ConfigurationDb

It works and now my application has 3 DB Contexts.

  • ApplicationDbContext
  • PersistedGrantDbContext
  • ConfigurationDbContext

My question is what are the two DB contexts for? What is the difference between the application db context and the other two?

If I update or add any models, do I need to update all three? Or when should I run a migration on the ApplicationDbContext and when to run on the other two.

Any insight or literature on these is appreciated. Thanks.

1 Answers
Related