Question: I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords.

Any ideas, how I can accomplish this?

Answer: 
In the accepted answer, "Bearer " is required to be written before the actual token.
A similar approach in which typing **"Bearer " can be skipped** is the following:

```cs
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Example API", Version = "v1" });

c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
{
    Type = SecuritySchemeType.Http,
    BearerFormat = "JWT",
    In = ParameterLocation.Header,
    Scheme = "bearer",
    Description = "Please insert JWT token into field"
});

c.AddSecurityRequirement(new OpenApiSecurityRequirement
{
    {
        new OpenApiSecurityScheme
        {
            Reference = new OpenApiReference
            {
                Type = ReferenceType.SecurityScheme,
                Id = "Bearer"
            }
        },
        new string[] { }
    }
});

```

Here, only pasting the JWT token is required for this to work.
If anyone is using NSwag and has landed here after searching the solution, here is the link from the official documentation.

[NSwag Enable JWT authentication](https://github.com/RicoSuter/NSwag/wiki/AspNetCore-Middleware#enable-jwt-authentication)

PS: *I know the original question was for SwashBuckle, but Google shows this link first when searching for NSwag as well.*