question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Case sensitivity for Swagger Authentication Scheme

See original GitHub issue

It’s a really small change, but the scheme for JWT Authentication is “bearer” not “Bearer” and yes Postman cares. Don;t know why but it does.

if you could just change

public static void EnableJWTBearerAuth(this AspNetCoreOpenApiDocumentGeneratorSettings settings)
    {
        settings.AddAuth("JWTBearerAuth", new OpenApiSecurityScheme
        {
            Type = OpenApiSecuritySchemeType.Http,
            Scheme = "Bearer",
            BearerFormat = "JWT",
            Description = "Enter a JWT token to authorize the requests..."
        });
    }

to

public static void EnableJWTBearerAuth(this AspNetCoreOpenApiDocumentGeneratorSettings settings)
    {
        settings.AddAuth("JWTBearerAuth", new OpenApiSecurityScheme
        {
            Type = OpenApiSecuritySchemeType.Http,
            Scheme = "bearer",
            BearerFormat = "JWT",
            Description = "Enter a JWT token to authorize the requests..."
        });
    }

Would be much appreciated.

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dj-nitehawkcommented, Sep 9, 2022

done 😉 v5.1.1-beta4 has been pushed out

0reactions
dj-nitehawkcommented, Oct 18, 2022

guess it’s so insignificant that it flew under everyone’s radar 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is security `scheme` value lowercase or case-insensitive?
client to provide authentication information. It uses a case- insensitive token as a means to identify the authentication scheme,
Read more >
OpenAPI Specification - Version 3.0.3
All field names in the specification are case sensitive. This includes all fields that are used as keys in a map, except where...
Read more >
OpenAPI Specification - Version 3.0.3
All field names in the specification are case sensitive. This includes all fields that are used as keys in a map, except where...
Read more >
Authentication
OpenAPI uses the term security scheme for authentication and authorization schemes. OpenAPI 3.0 lets you describe APIs protected using the following ...
Read more >
Basic Structure
All keyword names are case-sensitive. ... and security keywords are used to describe the authentication methods used in your API.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found