Skip to content

[Bug]: Authorization header missing from HTTP Requests in NET 10. #3648

@LightBulbIdea

Description

@LightBulbIdea

Describe the bug

I just upgraded my NET 9 Web API to NET 10 and all of its dependecies. I followed the migration guide https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/HEAD/docs/migrating-to-v10.md when upgrading Swagger. However, after changing to the new OpenApiSecurityRequirement expected object "OpenApiSecuritySchemeReference", swagger ui is no longer adding the Authorization header to my Http Calls.

During the migration I only had to update two things, namespaces for the models and the AddSecurityRequirement();.

I added Scalar UI support to my api just to be sure the issue is with swagger and Scalar UI works with no problems.

Any idea as to why Swagger UI is no longer appending the Authorization Header to my Http calls?

Swagger v10 configuration (Missing Authorization Header on every Http Call)

Image

Swagger v9.0.6 configuration (Works)

Image

The APP configuration is the same for both...

Image

Expected behavior

Authorization header with bearer token in the http header.

Actual behavior

Authorization header missing from http requests.

Steps to reproduce

No response

Exception(s) (if any)

No response

Swashbuckle.AspNetCore version

10.0.0

.NET Version

10

Anything else?

I use OAuth2 PKCE flow with Auth0 (been using this for the past 2 years with no problems until today)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions