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

Apikey authentication with an http param should be non case sensitive #705

Open
jgraglia opened this issue Nov 8, 2024 · 1 comment
Open

Comments

@jgraglia
Copy link

jgraglia commented Nov 8, 2024

Hi,

The apikey auth supports both http header & param.
For http params, the name should be case insensitive if I'm right https://www.rfc-editor.org/rfc/rfc9110.html#section-5.6.6
idem for headers .

But alpine server seems to require case sensitve params.

https://github.com/stevespringett/Alpine/blob/master/alpine-server/src/main/java/alpine/server/auth/ApiKeyAuthenticationService.java#L51C1-L52C1

Basically this request is ok

curl https://xxxxxx/api/v1/badge/vulns/project/<uuid>?apiKey=<secret>

and this one is rejected

curl https://xxxxxx/api/v1/badge/vulns/project/<uuid>?apikey=<secret>

I check jetty, and http params are case not sensitive (https://javadoc.jetty.org/jetty-12/org/eclipse/jetty/http/HttpField.html)

PS: I'm using Dependency Track and the apikey authentication to access badges.
I can't use the http header to authenticate as , for a badge, I just need an http link.

@jgraglia
Copy link
Author

jgraglia commented Nov 8, 2024

and for some reason my browser (Chrome) seems to lowercase the apiKey param.
In a std windows the url fails with 401
I an incognito windows, the auth is ok and the badge is displayed

With Firefox, no pb the case is "respected" in the URL

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

1 participant