title: .NET & Swagger started to get 401 error
body: <p>I have configured Swagger for my .NET Core webApi application, here is the configuration for it</p>
  
  <pre><code>        public void ConfigureServices(IServiceCollection services)
          {
              services.AddAuth();
  
              services.AddCors(options =&gt;
              {
                  options.AddPolicy("CorsPolicy",
                      builder =&gt; builder.AllowAnyOrigin()
                          .AllowAnyMethod()
                          .AllowAnyHeader()
                          .AllowCredentials()
                          .Build());
              });
  
              services.AddMvc();
              services.AddSwaggerGen(c =&gt;
              {
                  c.SwaggerDoc("v1",
                      new Info
                      {
                          Version = "v1",
                          Title = "XXX Synchronization API",
                          Description = "XXX Synchronization API",
                          TermsOfService = "None",
                          Contact = new Contact { Name = "XXX Inc.", Email = "XXXX", Url = "XXX.com" }
                      });
                  c.IncludeXmlComments(GetXmlCommentsPath());
                  c.DescribeAllEnumsAsStrings();
              });
  
              services.AddSingleton&lt;IHashProvider, Pbkdf2Version1HashProvider&gt;();
              services.AddSingleton&lt;IPasswordHasher, PasswordHasher&gt;();
              services.AddTransient&lt;IAuthenticationService, GfdAuthenticationService&gt;();
              services.AddSingleton(new GfdSqlServerDatabase(Gfd2Configuration.Settings.GfdSqlServerConnectionString));
              services.AddSingleton(new MySqlSyncDatabase(Gfd2Configuration.Settings.AwsMySqlConnectionString));
              services.AddTransient&lt;SyncRepository, AwsMySqlSyncRepository&gt;();
              services.AddHostedService&lt;QueuedHostedService&gt;();
              services.AddSingleton&lt;IBackgroundTaskQueue, BackgroundTaskQueue&gt;();
              services.AddSingleton&lt;ArchivedJobProcessorBase, ArchivedJobProcessorFeatures&gt;();
          }
  
          /// &lt;summary&gt;
          /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
          /// &lt;/summary&gt;
          /// &lt;param name="app"&gt;&lt;/param&gt;
          /// &lt;param name="env"&gt;&lt;/param&gt;
          public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
  
              app.UseAuthentication();
              app.UseCors("CorsPolicy");
              app.UseMvc();
  
              app.UseSwagger();
  
  #if DEBUG
              app.UseSwaggerUI(c =&gt; { c.SwaggerEndpoint("/swagger/v1/swagger.json", "XXXX Synchronization API V1"); });
  #else
              app.UseSwaggerUI(c =&gt; { c.SwaggerEndpoint("/sync/swagger/v1/swagger.json", "XXX Synchronization API V1"); });
  #endif
          }
  </code></pre>
  
  <p>and everything was wokring fine. And for some reason this morning anytime I open the <code>/swagger</code> url I'm getting a 401 error.
  I don't need any authentication for the Swagger docs and UI, all is public. </p>
  
  <p>Could this be related to <code>.NET Core 2.1.2</code>? </p>
  
  <p>using <code>Swashbuckle.AspNetCore 3.0.0</code></p>
  
  <p>Any ideas are welcome.</p>