title: Issue in CORS in ASP .NET Core - The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*
body: <p>I'm getting the below error</p>
  
  <p>Access to XMLHttpRequest at '<a href="http://localhost:5000/api/values/track/?name=name&amp;time=1589425390870" rel="nofollow noreferrer">http://localhost:5000/api/values/track/?name=name&amp;time=1589425390870</a>' from origin '<a href="http://localhost:23456" rel="nofollow noreferrer">http://localhost:23456</a>' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.</p>
  
  <p>I have configured Asp.net core app like below</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
          {
  
              services.AddCors(o =&gt; o.AddPolicy("MyPolicy", builder =&gt;
              {
                  builder.AllowAnyOrigin()
                         .AllowAnyMethod()
                         .AllowAnyHeader().AllowCredentials() ;
              }));
  
  
              services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
          }
  
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
  
              app.UseCors("MyPolicy");
              app.UseMvc();
          }
  </code></pre>
  
  <p><strong>Content type: application/x-www-form-urlencoded</strong></p>
  
  <p>Can some one please help me in resolving this issue?</p>