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

feat: add specCompliance option, option to set case insensitive for bearerType #172

Merged
merged 5 commits into from
Dec 31, 2023

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Dec 31, 2023

Resolves #169

Checklist

@Uzlopak Uzlopak marked this pull request as ready for review December 31, 2023 02:38
Readme.md Outdated Show resolved Hide resolved
test/spec-compliance-rfc-6749.test.js Dismissed Show dismissed Hide dismissed
test/spec-compliance-rfc-6750.test.js Dismissed Show dismissed Hide dismissed
@Uzlopak
Copy link
Contributor Author

Uzlopak commented Dec 31, 2023

@climba03003
@mcollina
@jsumners

I applied the requested change by @climba03003 . I personally dont know why rfc6749 is case insensitive but rfc6750 is case sensitive. I feel a little bit "blind" now after reading multiple times in these rfcs. But I trust your assessment. ;).

Readme.md Outdated Show resolved Hide resolved
Co-authored-by: KaKa <23028015+climba03003@users.noreply.github.com>
Signed-off-by: Aras Abbasi <aras.abbasi@googlemail.com>
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Uzlopak Uzlopak changed the title feat: add bearerTypeCaseSensitive option feat: add specCompliance option, option to set case insensitive for bearerType Dec 31, 2023
@Uzlopak Uzlopak merged commit bf525cb into master Dec 31, 2023
21 checks passed
@Uzlopak Uzlopak deleted the bearer-type-case-sensitive branch December 31, 2023 18:03
@Uzlopak
Copy link
Contributor Author

Uzlopak commented Dec 31, 2023

Happy new year, lol

@jogu
Copy link

jogu commented Jan 22, 2024

Could you please clarify where you think RFC6750 says the HTTP authentication scheme name should be treated case sensitively?

I cannot find this stated.

I know that people do often look at this section https://www.rfc-editor.org/rfc/rfc6750#section-2.1 where it says:

credentials = "Bearer" 1*SP b64token

and assume this means case sensitive, however as per the document that defines this ABNF syntax, https://www.rfc-editor.org/rfc/rfc5234#section-2.3 (see screenshot below), this is defining "Bearer" to be case insensitive:

Screenshot_2022-09-30_at_18 33 28

The underlying spec that defines HTTP authentication (which is what RFC6750 builds upon), https://www.rfc-editor.org/rfc/rfc9110#name-authentication-scheme states:

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

@climba03003
Copy link
Member

@jogu
Look's like you are correct as it is using the ABNF syntax.
It is really a problem in the interpretation of specification requires such a deep knowledge and dig through.

According to the issue linked from this PR and all the reference inside.
Seems like we are not the only one who interpret it wrongly and agreed on it is case-sensitive.
What a disaster.

@jogu
Copy link

jogu commented Jan 23, 2024

Yeah, definitely. As I said in oauth-wg/oauth-v2-1#166 I hope this can be clarified in the upcoming 2.1 revision of the OAuth specification so that it's not such a big issue in the future.

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

Successfully merging this pull request may close these issues.

Does BearerType need to be case sensitive ?
4 participants