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

case sensitivity of Bearer http authentication scheme #166

Closed
jogu opened this issue Jan 22, 2024 · 4 comments
Closed

case sensitivity of Bearer http authentication scheme #166

jogu opened this issue Jan 22, 2024 · 4 comments

Comments

@jogu
Copy link

jogu commented Jan 22, 2024

It seems to be a common interoperability issue (and a source of some really great arguments as to who is wrong, e.g. fastify/fastify-bearer-auth#172 (comment) ) that some implementations treat the 'Bearer' http authentication scheme name as case sensitive.

As far as I can find, HTTP authentication schemes are case insensitive; in particular https://www.rfc-editor.org/rfc/rfc9110#name-authentication-scheme says:

It uses a case-insensitive token to identify the authentication scheme:

Regardless of whether my conclusion is correct, I think we should add a sentence to OAuth 2.1 that makes it clear if it is case sensitive or not.

@jogu
Copy link
Author

jogu commented Jan 22, 2024

I think people often get confused by https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-10#section-5.1.1 in particular:

credentials = "Bearer" 1*SP token68

so this might be a good place to add an additional sentence. (As per https://www.rfc-editor.org/rfc/rfc5234#section-2.3 I believe this is defining 'Bearer' as a case insensitive match.)

@aaronpk
Copy link
Member

aaronpk commented May 11, 2024

Should we update the abnf description to use lowercase too then just for good measure?

@aaronpk aaronpk added the interim Items to discuss in the next WG interim meeting label May 11, 2024
@jogu
Copy link
Author

jogu commented May 11, 2024

Good question and I don't really know if there's any precedent here. "Bearer" is the official name as per https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml#authschemes but I'm not sure that matters.

@aaronpk
Copy link
Member

aaronpk commented May 14, 2024

As discussed in the May 14 interim:

Keep the examples with the capital B, and add a sentence clarifying that the scheme is case insensitive.

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