title: OpenId + Jwt Bearer with ASP.NET Core: The signature is invalid
body: <p>I'm trying to integrate openid with JWT Bearer middleware in my asp.net core project.</p>
  
  <p>Here is my startup code:</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
          {
              loggerFactory.AddConsole(Configuration.GetSection("Logging"));
              loggerFactory.AddDebug();
  
              app.UseCors(builder =&gt; builder.AllowAnyOrigin()
                  .AllowCredentials()
                  .AllowAnyMethod()
                  .AllowAnyHeader());
  
              app.UseJwtBearerAuthentication(new JwtBearerOptions()
              {
                  AuthenticationScheme = JwtBearerDefaults.AuthenticationScheme,
                  AutomaticAuthenticate = true
              });
  
              app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
              {
                  ClientId = "&lt;my-client-id&gt;",
                  ClientSecret = "&lt;my-client-secret&gt;",
                  Authority = "https://accounts.google.com",
                  ResponseType = OpenIdConnectResponseType.Code,
                  GetClaimsFromUserInfoEndpoint = true,
                  CallbackPath = "/api/home/redirect",
                  Scope = { "email", "openid", "profile"},
                  SignInScheme = JwtBearerDefaults.AuthenticationScheme
              });
  
  
              app.UseMvc();
          }
  </code></pre>
  
  <p>When I send request to api/home (This request requires authentication), it throws me an error response:</p>
  
  <p><strong>WWW-Authenticate →Bearer error="invalid_token", error_description="The signature is invalid"</strong></p>
  
  <p>What am I missing. 
  Could anyone help me please ?</p>
  
  <p>Thank you.</p>