public static void RegisterInMongoDb(this List <Client> clients, ServiceOptions options) { MongoDbContext context = new MongoDbContext(options.ConnectionStringName, new[] { "of", "IdentityServer3" }); MongoDbClientStore store = new MongoDbClientStore(context); foreach (Client client in clients) { bool exists = store.Exists(x => x.Id == client.ClientId); if (exists) { continue; } store.Create(new MongoDbClient(client)); } }
public ClientConfigurationCorsPolicyService(IClientStore store) { _store = (MongoDbClientStore)store; }