Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Empty AuthScheme not possible for headers #118

Closed
418Coffee opened this issue Mar 2, 2023 · 1 comment · Fixed by #123
Closed

Empty AuthScheme not possible for headers #118

418Coffee opened this issue Mar 2, 2023 · 1 comment · Fixed by #123

Comments

@418Coffee
Copy link
Contributor

Hello,

I'm trying to do something similar to #103, extract a JWT from a custom header field.

{
    "X-Auth": "eyJ....."
}

I believe currently, it's impossible to achieve this, because an empty AuthScheme value gets interpreted as default and set to "Bearer":

if cfg.AuthScheme == "" {
    cfg.AuthScheme = "Bearer"
}

Perhaps we can default AuthScheme to "Bearer" if AuthScheme == "" && TokenLookup == defaultTokenLookup.
Please let me know what you think about this. I would be happy to make a PR.

@gaby
Copy link
Member

gaby commented Apr 11, 2023

@418Coffee Send a PR, as long as it's backwards compatible should be fine. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants