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

feature: Parse only Bearer tokens and or unnamed tokens #96

Open
BreX900 opened this issue Dec 27, 2023 · 0 comments
Open

feature: Parse only Bearer tokens and or unnamed tokens #96

BreX900 opened this issue Dec 27, 2023 · 0 comments
Labels
feature-request New feature or request

Comments

@BreX900
Copy link

BreX900 commented Dec 27, 2023

I congratulate you on the plugin before I start!

Is your feature request related to a problem?

I request this feature because of WooCommerce, but in general any other plugin could work this way.
When the user is not logged in, I don't have a JWT to pass to WooCommerce endpoints.
So I am forced to use Basic Authorization or OAuth V1. But if I pass on the header one of these authorizations, this JWT plugin will intercept the header and throw an error because according to it it is invalid.

Describe the solution you'd like

My solution would be to force the token with the word Bearer in front of it to be passed on the header. The new regex would be ^(?:Bearer\s)(.*)$ for the file BaseService.php line 168.
If this is not possible, I would say that it would be great that if the value in the header starts with something other than Bearer it would ignore the token. The regex then could be ^(?:Bearer\s)?([^\s]+)$

Additional context

You can test the problem by running the product call for WooCommerce using Basic Authorization or OAuth V1. Enabling auto login with the key in theAuthorization header.

I know I can set this JWT plugin to read the value on a different key in the header but I would like to avoid.

@BreX900 BreX900 added the feature-request New feature or request label Dec 27, 2023
@nicumicle nicumicle moved this to To do in Simple JWT Login Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
Status: To do
Development

No branches or pull requests

1 participant