title: Openiddict Unable to resolve service for type 'OpenIddict.Core.IOpenIddictApplicationStore`
body: <p>I'm trying to setup the .net core project using identity + jwt authorization, but I'm getting the following error:</p>
  
  <blockquote>
    <p>System.InvalidOperationException: Unable to resolve service for type 'OpenIddict.Core.IOpenIddictApplicationStore<code>1[OpenIddict.Models.OpenIddictApplication]' while attempting to activate 'OpenIddict.Core.OpenIddictApplicationManager</code>1[OpenIddict.Models.OpenIddictApplication]'.</p>
  </blockquote>
  
  <p>Here is my configuration:</p>
  
  <pre><code>public class Startup
  {
      public Startup(IHostingEnvironment env)
      {
          var builder = new ConfigurationBuilder()
              .SetBasePath(env.ContentRootPath)
              .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
              .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
              .AddEnvironmentVariables();
          Configuration = builder.Build();
      }
  
      public IConfigurationRoot Configuration { get; }
  
      // This method gets called by the runtime. Use this method to add services to the container.
      public void ConfigureServices(IServiceCollection services)
      {
          // Add framework services.
          services.AddMvc();
  
          services.AddEntityFrameworkSqlServer()
              .AddDbContext&lt;ApplicationDbContext&gt;(options =&gt; {
                  options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]);
                  options.UseOpenIddict();
          });
  
          // add identity
          services.AddIdentity&lt;ApplicationUser, IdentityRole&gt;()
              .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;()
              .AddDefaultTokenProviders();
  
          // add OpenIddict
          services.AddOpenIddict()
              .DisableHttpsRequirement()
              .EnableTokenEndpoint("/api/authenticate/token")
              .AllowPasswordFlow()
              .AllowRefreshTokenFlow()
              .UseJsonWebTokens()
              .AddEphemeralSigningKey();
  
          services.AddTransient&lt;IDatabaseInitializer, DatabaseInitializer&gt;();
      }
  
      // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
      public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IDatabaseInitializer initializer)
      {
          loggerFactory.AddConsole(Configuration.GetSection("Logging"));
          loggerFactory.AddDebug();
  
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
              app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
                  HotModuleReplacement = true
              });
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
          }
  
          app.UseStaticFiles();
  
          app.UseOpenIddict();
  
          // use jwt bearer authentication
          app.UseJwtBearerAuthentication(new JwtBearerOptions
          {
              AutomaticAuthenticate = true,
              AutomaticChallenge = true,
              RequireHttpsMetadata = false,
              Audience = "http://localhost:1804/",
              Authority = "http://localhost:1804/"
          });
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=Home}/{action=Index}/{id?}");
  
              routes.MapSpaFallbackRoute(
                  name: "spa-fallback",
                  defaults: new { controller = "Home", action = "Index" });
          });
  
          initializer.Seed();
      }
  }
  </code></pre>
  
  <p>The error appears when I try to call the <code>/api/authenticate/token</code> path.
  Could anyone help me in resolving that issue?</p>