simple-jwt-authentication icon indicating copy to clipboard operation
simple-jwt-authentication copied to clipboard

jwt_auth_no_auth_header for valid tokens can happen

Open autotel opened this issue 5 years ago • 1 comments

I ran into this issue and found someone who solved it by changing the library code. I came here to check whether he had added an issue, and it seems not. The problem in question and the solution is detailed by that author: https://stackoverflow.com/questions/44322866/jwt-auth-no-auth-header-error-on-validating-wordpress-rest-api-jwt-token

autotel avatar Mar 30 '20 09:03 autotel

Hmm alright I see.. So essentially add a secondary check for the Authorization header key if none is found with the default HTTP_AUTHORIZATION..

Seems a valid approach tbh. You could actually also just set the SIMPLE_JWT_AUTHENTICATION_HEADER_NAME global yourself to Authorization and it'd work. In your wp-config.php:

define( ' SIMPLE_JWT_AUTHENTICATION_HEADER_NAME', 'Authorization' );

I believe that would work but I haven't tried it myself.

jonathan-dejong avatar May 18 '20 14:05 jonathan-dejong