【问题标题】:IdentityServer4 with persistent database具有持久数据库的 IdentityServer4
【发布时间】:2019-07-21 05:47:41
【问题描述】:

我正在尝试将 IdentityServer4 与持久数据库一起使用。我有一个 Oracle 数据库。我正计划扩展 ConfigurationDbContextPersistedGrantDbContext 以便进行一些特定于 Oracle 的定制。

PersistedGrantDbContext

 public class IdentityPersistedGrantDbContext : PersistedGrantDbContext {
    public IdentityPersistedGrantDbContext(DbContextOptions<PersistedGrantDbContext> options, OperationalStoreOptions storeOptions)
         : base(options, storeOptions) {
    }
}

ConfigurationDbContext

public class IdentityConfigurationDbContext : ConfigurationDbContext {
    public IdentityConfigurationDbContext(DbContextOptions<ConfigurationDbContext> options, ConfigurationStoreOptions storeOptions)
         : base(options, storeOptions) {
    }
}

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

【问题讨论】:

    标签: asp.net-core asp.net-identity identityserver4


    【解决方案1】:

    here 所示实现IPersistedGrantStore。并将其添加到 ASP.NET Core ServiceCollection(也称为 DI 容器)中。

    例如:

            services.AddTransient<IPersistedGrantStore, MyPersistedGrantStore>();
    

    MyPersistedGrantStore 使用该 DbContext 来执行接口/合同中定义的那些 CRUD 操作。

    【讨论】:

    • 如何使用用户名和密码验证用户。
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 2012-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-20
      • 1970-01-01
      • 2017-08-09
      • 1970-01-01
      • 2019-08-07
      相关资源
      最近更新 更多