Allow customizing httpBearerAuth scheme
See original GitHub issueI’d like to model a service that uses what is effectively the HTTP Bearer authentication mechanism but with a different scheme. Would it be possible to extend the httpBearerAuth trait to support this?
I’m thinking something like this:
@httpBearerAuth(scheme="ApiKey")
which would result in HTTP requests with an Authorization: ApiKey {key} header. Existing services or services that use the Bearer scheme would continue to use @httpBearerAuth without the parameter – I’m hoping that’s possible but am still new to the Smithy syntax.
Is this possible? Is it a bad idea? Is there a better way to accomplish this? I think the alternative is to create a new @authDefinition that does the right thing, but I don’t particularly want to reinvent all of the surrounding codegen ecosystem just to change from Bearer to ApiKey. On a related note, I recognize that existing codegen would need to be updated to support this, where would I go to learn more?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)

Top Related StackOverflow Question
@glb Have a look at that pull request. I think it enables your use-case
Thanks @mtdowling !