Skip to content

Authenticated Swagger seems to be impossible in Dotnet 9+ #2264

@genifycom

Description

@genifycom

Describe the feature

Once the nuget page is updated to v9.x+ we cannot use authenticated Swagger

<PackageReference Include="Amazon.Lambda.AspNetCoreServer" Version="9.2.0" />

AWS rewrote the entire marshalling layer:
• Removed all extensibility points
• Hard‑filter “unsafe” headers
• WWW-Authenticate is one of those headers (considered unsafe)
• There is no override, no hook, no extension point
• API Gateway proxy mode cannot add or rewrite headers
• Integration Response mappings are disabled in proxy mode
So the header is stripped, and you cannot restore it.

This is why:
• Swagger JSON returns 401
• But the browser never sees the challenge
• And Swagger UI fails to load
This appears to be a real AWS limitation..

What can we do to get authenticated Swagger?

Use Case

Unauthenticated Swagger is a security risk.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS .NET SDK and/or Package version used

<PackageReference Include="Amazon.Lambda.AspNetCoreServer" Version="9.2.0" />

Targeted .NET Platform

.NET framework 8

Operating System and version

Windows 11

Metadata

Metadata

Assignees

Labels

feature-requestA feature should be added or improved.investigatingThis issue is being investigated and/or work is in progress to resolve the issue.needs-reproductionThis issue needs reproduction.response-requestedWaiting on additional info and feedback. Will move to close soon in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions