title: InvalidOperationException: Key type not specified. Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()
body: <p><strong>Summary</strong></p>
  
  <p>Attempting to publish a basic .NET Core React app with auth functionality I am receiving an error with IdentityServer. This is using dotnet new react --auth Individual, .Net Core 3.0 Preview5, and following the instructions <a href="https://elanderson.net/2019/03/asp-net-core-3-react-template-with-auth/#comment-95427" rel="noreferrer">here</a> and <a href="https://elanderson.net/2019/07/deploy-asp-net-core-3-previews-to-azure-app-using-extensions/" rel="noreferrer">here</a>.</p>
  
  <p>I've uploaded the PFX via the TLS/SSL settings. I've also ensured the certificate works on my dev environment, finding that <code>GetMyX509Certificate</code> returns the cert.</p>
  
  <p>The code causing the issue seems to be in Configure in Startup.cs when running app.UseIdentityServer():</p>
  
  <pre><code>    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
      {
          //...
  
          Log.Information("Configure - running app.Use: Authentication, IdentityServer");
  
         Log.Information("Configure - running app.Use: Authentication");
          app.UseAuthentication();
          Log.Information("Configure - running app.Use: IdentityServer");
          app.UseIdentityServer();
  
          //CODE DOESN'T MAKE IT HERE!!!
          Log.Information("Configure - running app.UseMvc");
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller}/{action=Index}/{id?}");
          });
  
          Log.Information("Configure - running app.UseSpa");
  
          app.UseSpa(spa =&gt;
          {
              spa.Options.SourcePath = "ClientApp";
  
              if (env.IsDevelopment())
              {
                  spa.UseReactDevelopmentServer(npmScript: "start");
              }
          });
  
          Log.Information("Configure - Done!");
      }
  </code></pre>
  
  <p><strong>The Error</strong></p>
  
  <p>Activating <code>ASPNETCORE_DETAILEDERRORS = true</code>, I am getting the following error:</p>
  
  <pre><code>InvalidOperationException: Key type not specified
  
  Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()
      Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.Configure(ApiAuthorizationOptions options)
      Microsoft.Extensions.Options.OptionsFactory&lt;TOptions&gt;.Create(string name)
      Microsoft.Extensions.Options.OptionsManager&lt;TOptions&gt;+&lt;&gt;c__DisplayClass5_0.&lt;Get&gt;b__0()
      System.Lazy&lt;T&gt;.ViaFactory(LazyThreadSafetyMode mode)
      System.Lazy&lt;T&gt;.ExecutionAndPublication(LazyHelper executionAndPublication, bool useDefaultConstructor)
      System.Lazy&lt;T&gt;.CreateValue()
      System.Lazy&lt;T&gt;.get_Value()
      Microsoft.Extensions.Options.OptionsCache&lt;TOptions&gt;.GetOrAdd(string name, Func&lt;TOptions&gt; createOptions)
      Microsoft.Extensions.Options.OptionsManager&lt;TOptions&gt;.Get(string name)
      Microsoft.Extensions.Options.OptionsManager&lt;TOptions&gt;.get_Value()
      Microsoft.Extensions.DependencyInjection.IdentityServerBuilderConfigurationExtensions+&lt;&gt;c.&lt;AddClients&gt;b__7_1(IServiceProvider sp)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor&lt;TArgument, TResult&gt;.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor&lt;TArgument, TResult&gt;.VisitCallSite(ServiceCallSite callSite, TArgument argument)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor&lt;TArgument, TResult&gt;.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor&lt;TArgument, TResult&gt;.VisitCallSite(ServiceCallSite callSite, TArgument argument)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor&lt;TArgument, TResult&gt;.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor&lt;TArgument, TResult&gt;.VisitCallSite(ServiceCallSite callSite, TArgument argument)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine+&lt;&gt;c__DisplayClass1_0.&lt;RealizeService&gt;b__0(ServiceProviderEngineScope scope)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
      Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
      Microsoft.AspNetCore.Builder.IdentityServerApplicationBuilderExtensions.TestService(IServiceProvider serviceProvider, Type service, ILogger logger, string message, bool doThrow)
      Microsoft.AspNetCore.Builder.IdentityServerApplicationBuilderExtensions.Validate(IApplicationBuilder app)
      Microsoft.AspNetCore.Builder.IdentityServerApplicationBuilderExtensions.UseIdentityServer(IApplicationBuilder app)
      ReactWithAuth.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in Startup.cs
      System.RuntimeMethodHandle.InvokeMethod(object target, object[] arguments, Signature sig, bool constructor, bool wrapExceptions)
      System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
      Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(object instance, IApplicationBuilder builder)
      Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder+&lt;&gt;c__DisplayClass4_0.&lt;Build&gt;b__0(IApplicationBuilder builder)
      Microsoft.AspNetCore.Hosting.Internal.ConventionBasedStartup.Configure(IApplicationBuilder app)
      Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter+&lt;&gt;c__DisplayClass0_0.&lt;Configure&gt;g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
      Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter+&lt;&gt;c__DisplayClass2_0.&lt;Configure&gt;b__0(IApplicationBuilder app)
      Microsoft.AspNetCore.HostFilteringStartupFilter+&lt;&gt;c__DisplayClass0_0.&lt;Configure&gt;b__0(IApplicationBuilder app)
      Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
          Microsoft.Extensions.DependencyInjection.IdentityServerBuilderExtensionsCrypto.AddSigningCredential(IIdentityServerBuilder builder, X509Certificate2 certificate)
          Projects.Startup.ConfigureServices(IServiceCollection services) in Startup.cs
          System.RuntimeMethodHandle.InvokeMethod(object target, object[] arguments, Signature sig, bool constructor, bool wrapExceptions)
          System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
          Microsoft.AspNetCore.Hosting.Internal.ConfigureServicesBuilder.InvokeCore(object instance, IServiceCollection services)
          Microsoft.AspNetCore.Hosting.Internal.ConfigureServicesBuilder+&lt;&gt;c__DisplayClass9_0.&lt;Invoke&gt;g__Startup|0(IServiceCollection serviceCollection)
          Microsoft.AspNetCore.Hosting.Internal.StartupLoader+ConfigureServicesDelegateBuilder&lt;TContainerBuilder&gt;+&lt;&gt;c__DisplayClass15_0.&lt;BuildStartupServicesFilterPipeline&gt;g__RunPipeline|0(IServiceCollection services)
          Microsoft.AspNetCore.Hosting.Internal.ConfigureServicesBuilder.Invoke(object instance, IServiceCollection services)
          Microsoft.AspNetCore.Hosting.Internal.ConfigureServicesBuilder+&lt;&gt;c__DisplayClass8_0.&lt;Build&gt;b__0(IServiceCollection services)
          Microsoft.AspNetCore.Hosting.Internal.StartupLoader+ConfigureServicesDelegateBuilder&lt;TContainerBuilder&gt;+&lt;&gt;c__DisplayClass14_0.&lt;ConfigureServices&gt;g__ConfigureServicesWithContainerConfiguration|0(IServiceCollection services)
          Microsoft.AspNetCore.Hosting.Internal.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
          Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
          Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
          Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
  </code></pre>
  
  <p><strong>Things I've tried</strong></p>
  
  <p>There's not much out there in the way of solutions. The IdentityServer4 only talks about types in terms of <a href="http://docs.identityserver.io/en/latest/topics/grant_types.html" rel="noreferrer">Grant Types</a>, but this seems prior to that.</p>