Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse JWT - suggested fix #134

Closed
Malieux opened this issue Aug 28, 2024 · 2 comments
Closed

Failed to parse JWT - suggested fix #134

Malieux opened this issue Aug 28, 2024 · 2 comments

Comments

@Malieux
Copy link

Malieux commented Aug 28, 2024

Hello,
First of all thanks for your work!
When using your module I came across "failed to parse JWT" error multiple times. After digging in it turns out that in Authorization header 'bearer' was not in capital letter. According to standards RFC 7235 Section 2.1 the auth-scheme part of an HTTP Authorization header is case-insensitive.
My quickfix was to change this line to
if (ngx_strncasecmp(jwtHeaderVal->value.data, (u_char *)BEARER_PREFIX, strlen(BEARER_PREFIX)) == 0)
But I'm no C developer so I believe you could fix it in more elegant way.
Thanks in advance.

@JoshMcCullough
Copy link
Contributor

Thanks for this! PR is here, using your fix exactly as you have it (plus some other unrelated fixes).

@JoshMcCullough
Copy link
Contributor

PR is merged and new release is up!

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

No branches or pull requests

2 participants