首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >持久化数据库的IdentityServer4

持久化数据库的IdentityServer4
EN

Stack Overflow用户
提问于 2017-02-21 12:53:41
回答 2查看 3.3K关注 0票数 3

我试图在持久化数据库中使用IdentityServer4。我有甲骨文数据库。我计划扩展ConfigurationDbContextPersistedGrantDbContext,以便进行一些特定于甲骨文的定制。

PersistedGrantDbContext

代码语言:javascript
复制
 public class IdentityPersistedGrantDbContext : PersistedGrantDbContext {
    public IdentityPersistedGrantDbContext(DbContextOptions<PersistedGrantDbContext> options, OperationalStoreOptions storeOptions)
         : base(options, storeOptions) {
    }
}

ConfigurationDbContext

代码语言:javascript
复制
public class IdentityConfigurationDbContext : ConfigurationDbContext {
    public IdentityConfigurationDbContext(DbContextOptions<ConfigurationDbContext> options, ConfigurationStoreOptions storeOptions)
         : base(options, storeOptions) {
    }
}

在启动类中,我是否告诉IdentityServer使用自定义类?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-02-21 18:48:34

IPersistedGrantStore实现为这里。并将其添加到ASP.NET核心ServiceCollection (也称为DI容器)中。

例:

代码语言:javascript
复制
        services.AddTransient<IPersistedGrantStore, MyPersistedGrantStore>();

其中,MyPersistedGrantStore使用该DbContext执行接口/契约中定义的CRUD操作。

票数 3
EN

Stack Overflow用户

发布于 2017-07-26 00:31:44

它位于IdghtyServer4.中。为IdentityServer4.EntityFramework.DbContexts添加一个using语句

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42367893

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档