Skip to content

b64 regex token checks #127

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

Closed
jankapunkt opened this issue Feb 1, 2022 · 2 comments
Closed

b64 regex token checks #127

jankapunkt opened this issue Feb 1, 2022 · 2 comments
Labels
compliance 📜 OAuth 2.0 standard compliance good first issue ✅ Good for newcomers

Comments

@jankapunkt
Copy link
Member

@jorenvandeweyer commented on pr #105:

In the spec it is defined as it should start with Bearer followed with a whitespace. That's what the additional ^ in the regex is for. I think we should not support BeArEr @Uzlopak

b64token = 1*( ALPHA / DIGIT /
"-" / "." / "_" / "~" / "+" / "/" ) "="
credentials = "Bearer" 1
SP b64token

But I do like the check provided for the second part. But that should be a different issue/pull request. Because that check should also be done on the result of generateAccessToken and generateRefreshToken.

@jankapunkt jankapunkt added good first issue ✅ Good for newcomers compliance 📜 OAuth 2.0 standard compliance labels Feb 1, 2022
@jankapunkt
Copy link
Member Author

Does it make sense to implement this here: https://github.com/node-oauth/formats ?

@jorenvandeweyer
Copy link
Member

The correct regex would be ^Bearer\s[0-9a-zA-Z-._~+/]+=*$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compliance 📜 OAuth 2.0 standard compliance good first issue ✅ Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants