Custom header settings not picked up when using OAuth2 security scheme #1935
Labels
status:no-recent-activity
No recent activity on this thread, about to be closed
status:waiting-for-author-feedback
Issue that we've responded but needs author feedback to close
Describe the bug
When using
Swashbuckle.AspNetCore
and specifying a secutiy schema of typeSecuritySchemeType.ApiKey
, we are able to customize the header used to send the token using the Name property. However this doesn't seem to work when you have an implicit OAuth2 flow as described in the code below. The OAuth flow works fine, but the token is sent to the api over the Authorization header which is not desired.OpenApi File To Reproduce
Excerpt from the generates OpenAPI document:
Expected behavior
The custom header
x-custom-auth-token
should be used in place of AuthorizationScreenshots/Code Snippets
Additional context
This issue was originally raised here: domaindrivendev/Swashbuckle.AspNetCore#3138. Investigation by @martincostello shows that the header isn't in the OpenAPI document, but it's on the
OpenApiDocument
in memory.The text was updated successfully, but these errors were encountered: