public static IdentityServerServiceFactory Configure(string connString) { var efConfig = new EntityFrameworkServiceOptions { ConnectionString = connString, //Schema = "foo" }; var cleanup = new TokenCleanup(efConfig, 10); cleanup.Start(); // these two calls just pre-populate the test DB from the in-memory config ConfigureClients(Clients.Get(), efConfig); ConfigureScopes(Scopes.Get(), efConfig); var factory = new IdentityServerServiceFactory(); factory.RegisterConfigurationServices(efConfig); factory.RegisterOperationalServices(efConfig); factory.CorsPolicyService = new ClientConfigurationCorsPolicyRegistration(efConfig); var userService = new Thinktecture.IdentityServer.Core.Services.InMemory.InMemoryUserService(Users.Get()); factory.UserService = new Registration<IUserService>(resolver => userService); return factory; }